Keyword

Display Category name in K2 content module

More
10 years 7 months ago - 10 years 7 months ago #124770 by John
Hello,
I need to display the category name in a K2 content module that fetches 4 items from a category.
echo $item->catid; will give the correct category id but
echo $item->category->name; doesn't work.
What am i missing here?

Thank you
- John

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 7 months ago #124771 by Yiota
Why don't you just enable the category to show in your mod_k2_content module?

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

More
10 years 7 months ago #124772 by John
Show category was set on "Show"

I fount it (was working on a modified template overide that had everything they didnt use deleted) i checked the content module original default.php and i found out the variable.
echo $item->categoryname;

Thank you for your time

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 7 months ago #124773 by Yiota
You are welcome.

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


Powered by Kunena Forum