This is more of a PHP question but it is also related to Joomla.
category.php file, there are these lines:
<?php foreach($this->links as $key=>$item): ?> <div class="itemContainer"> <?php // Load category_item.php by default $this->item = $item; echo $this->loadTemplate('item'); ?> </div> <?php endforeach; ?>
which iterates through items in a category and load template(
category_item.php) for each one of them.
Now in the
category_item.php file, I wanna get information from another item (for example, in item 2, I wanna display image of item 3, sounds weird but it is what I want to do). In
category_item.php,this is how image gets displayed:
<img src="<?php echo $this->item->image; ?>">
$this here refers to the current item, so my question is, from within the
category_item.php file, is there anyway to refer to the category object? And is there anyway to refer to other items?