jonathancraddock.com
Hiking Recipes Photography Blog
  
Some PHP at last!   ( jonathancraddock.com http://jonathancraddock.com/images/M_images/arrow.png History  )
Saturday, 14 November 2009 17:17

Since my PHP course in May I've been meaning to put some of the training into practice, and now finally making a start. It's been a while, but it's making sense! First mini-project has been to add a "breadcrumbs" style of link to each article, straight after the article title. Joomla can sort of do this anyway, but not in the exact position or style that I wanted; it would write it underneath the article creation date. I'm in the process of coding it using template overrides to get the format I want.

For example, the frontpage links are generated with the following code:

<span class="headinglinks">  (
<?php echo '<a class="headinglinks" href="'.JRoute::_(ContentHelperRoute::getSectionRoute
 ($this->item->sectionid)).'">'; ?>
<?php echo $this->item->section; ?>
<?php echo '</a>'; ?>
<img src="/images/M_images/arrow.png"/>
<?php echo '<a class="headinglinks" href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug, $this->item->sectionid)).'">'; ?>
<?php echo $this->item->category; ?>
<?php echo '</a>'; ?>
 )</span>

Might still need a bit of tidying up, but will worry about that once it's all working. Frontpage, Article and Section have been done. Just looking at Categories now. More importantly, the logic of the PHP files is now far more clear. So far, so good!

 
 

Twitter Updates

    Follow me!