Keyword

display category name

More
12 years 11 months ago #58214 by nuno
display category name was created by nuno
How to display category name.

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

More
12 years 11 months ago #58215 by Olivier Karfis
Replied by Olivier Karfis on topic Re: display category name
Hi.

Can you give us more details on where you want to display that category name?

@olivierk

Owner of www.FrenchToday.com - K2 fan and freelancer, runs the Joomla/K2 tip site: www.yanaku.com

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

  • Fabrizio
  • Fabrizio's Avatar
  • Offline
  • New Member
  • Searching for The answer!
More
12 years 10 months ago #58216 by Fabrizio
Replied by Fabrizio on topic Re: display category name
Hi, i'm new to this board, but have some skills by customizing joomla and k2, for displaying the category name in a k2 article, you first have to fetch item attributes, then you can request for category name as follows:

<?php
//get item parameters -> itemCategory
$this->item->params->get('itemCategory');

//display category name
echo $this->item->category->name;
?>

you may not be able to fetch category item if you don't get items specific parameters, most of other item variables are treated the same way

Hope this helped out!.

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


Powered by Kunena Forum