O'Reilly logo

Joomla! 1.5 JavaScript jQuery by Jose Argudo Blanco

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Showing our images in the frontend

Of course, having our images uploaded is just the first step, now we need to show these images, but this is not going to be that hard. Open the components/com_tinynews/views/tinynews/tmpl/default.php file, and add the following code:

<div class="news_box">
            <?php
            if(!empty($new->image)){
            ?>
            <img src="<?php JURI::base(); ?>administrator/components/ com_tinynews/images/<?php echo $new->image; ?>" alt="<?php echo $new->caption; ?>" width="165px"/>
            <p><?php echo $new->caption; ?></p>
            <?php
            }
            ?>
            <h1><?php echo $new->title; ?></h1>
        

First, if we have some data in the image field, we prepare the img tag. Note that after the JURI::base(); method we have added administrator, but when we were working in the admin part, this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required