Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9. Going Further with Our Component Deve... > Working on our component's frontpage

Working on our component's frontpage

Now that we have worked a bit on our admin zone, it's time for us to work on the frontpage of our component, just to make it look better. At the moment, our component only shows a list of news. If you take a look at the components/com_tinynews/views/tinynews/tmpl/default.php file, you will see our previous code:

defined('_JEXEC') or die('Restricted access');
frontpage, Joomla! componentworking onforeach($this->news as $new){
echo "<p><b>".$new->title."</b></p><br/><br/>";
echo "<p>".$new->text."</p><br/><br/>";
}

We are going to change this code a bit, as follows:

defined('_JEXEC') or die('Restricted access');
foreach($this->news as $new){
?>
<div class="news_box">
<h1><?php echo $new->title; ?></h1>
<p><?php echo $new->text; ?></p>
</div>
<?php
}

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint