Show additional categories in events listing

  • Rusty
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 5 months ago #162141 by Rusty
In the frontend for the list of events, it shows the main category, is there a way that it can hide the main category but show the Additional Categories the event has been setup with instead?

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

More
1 year 5 months ago #162164 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Show additional categories in events listing
Could you send me link to that page? I will look at it and answer your question

Tuan

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

  • Rusty
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 5 months ago #162167 by Rusty
Here's the link to the all Events page:

leadershipexchange.gle.world/index.php?o...ents&id=0&Itemid=125

You'll notice it's showing the category of "Matches", we have three subcategories which I want to show in its place instead (along with a link to that category showing all Events that are in the category)

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

More
1 year 5 months ago #162173 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Show additional categories in events listing
Without knowing the files you customized to have that layout, I can only suggest you some code like this:

$categories = [];

foreach ($event->categories as $category)
{
$categoryUrl = Route::_(EventbookingHelperRoute::getCategoryRoute($category->id, $Itemid));
$categories[] = '<a href="' . $categoryUrl . '">' . $category->name . '</a>';
}

echo implode(', ', $categories);

Regards,

Tuan

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

Moderators: Tuan Pham Ngoc