By ittp on Thursday, 14 February 2019
Replies 5
Likes 0
Views 836
Votes 0
Hi,

I am trying to echo all categories to an event in /administrator/components/com_jevents/icalevent/overview.php.

How do I do this?
Hello,

That's just an example of how we do it. You would also need to change $event as they is likely not defined in the event view.


If you are in the loop already try:

$row

instead of $event

Many thanks
Tony
·
Tuesday, 19 February 2019 09:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Is this for multiple or single category support on the events?

Many thanks
Tony
·
Friday, 15 February 2019 00:43
·
0 Likes
·
0 Votes
·
0 Comments
·
For multiple
·
Friday, 15 February 2019 07:11
·
0 Likes
·
0 Votes
·
0 Comments
·
This is the query we use to load in ALLCATEGORIES




$db = JFactory::getDbo();
$arr_catids = array();
$catsql = "SELECT cat.id, cat.title as name, cat.params FROM #__categories as cat WHERE cat.extension='com_jevents' ";
$db->setQuery($catsql);
$allcat_catids = $db->loadObjectList('id');

$db = JFactory::getDbo();
$db->setQuery("Select catid from #__jevents_catmap WHERE evid = " . $event->ev_id());
$allcat_eventcats = $db->loadColumn();

$allcats = array();
foreach ($allcat_eventcats as $catid)
{
if (isset($allcat_catids[$catid]))
{
$allcats[] = $allcat_catids[$catid]->name;
}
}
$categories = implode(", ", $allcats);



$categories should then output a comma seperated list.
·
Monday, 18 February 2019 21:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks alot!

I am getting a Call to a member function ev_id() on null error. I can't find the table _categories in db
·
Tuesday, 19 February 2019 07:13
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post