How get the name of a category associated with an item

More
13 years 8 months ago #9246 by erc
I'm quite new to this, and I'm working on a template, which is a copy of the default template.

So, I'm working with category_items.php and I'm trying to figure out how to get the category for each item that is being listed.
Code:
<ul> <?php foreach ($this->items as $item) : ?> <li><?php echo $this->escape($item->categories->name); ?> <?php if ($this->params->get('link_titles', 0)) : ?> [url=<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $this->category->slug)); ?>]<?php echo $this->escape($item->title); ?>[/url] <?php else : echo $this->escape($item->title); endif; ?> </li> <?php endforeach; ?> </ul>

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.257 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline