A way to display the category name on the Event detail page?

  • Eli Pritykin
  • Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #114681 by Eli Pritykin
Looking for a way to display the category name on the event details page.

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

More
5 years 10 months ago #114683 by Tuan Pham Ngoc
Hi

You can go to Events Booking -> Configuration, look at Themes tab, set Show event's categories config option to Yes and it will be shown

Tuan

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

  • Eli Pritykin
  • Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #114685 by Eli Pritykin
Yes! Don't know how I missed that, thank you!

Taking it a bit further, I'd like to display the category directly under the title. I am looking in the components/com_eventbooking/view/event/tmpl/default.php and trying to figure out how to get the category to show just below the title, but I'm not finding the code responsible for displaying the category name... How can I get that working?

Thanks again

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

More
5 years 10 months ago #114699 by Tuan Pham Ngoc
Hi Eli

If so, you will have to write the code yourself. Below is the code which can be used to display categories, you can use it on the position you want
Code:
<?php $categories = []; foreach ($item->categories as $category) { $categoryUrl = JRoute::_(EventbookingHelperRoute::getCategoryRoute($category->id, $Itemid)); $categories[] = '<a href="' . $categoryUrl . '">' . $category->name . '</a>'; } echo implode(',' , $categories); ?>

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

Moderators: Tuan Pham Ngoc