×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Category description not shown when no events

Category description not shown when no events 7 years 8 months ago #34722

  • Ing Christian Galko
  • Ing Christian Galko's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 0
Hello,
I added a category description (image +text)
when I select just this category in the filter, the description is shown
But when there are no events in this category actually, the description is not displayed also.

Is there any way to configure this or which php file would have to be modified?
thanks,

Category description not shown when no events 7 years 8 months ago #34728

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hi Christian,

i fear this is more then just modifying one line. The category description is taken out of the events.. You would need to insert a query etc.

If you really want to do that you have to make a template override for components/com_matukio/views/eventlist/tmpl/bootstrap3.php and in there search for COM_MATUKIO_NO_EVENTS_FOUND

After that line you have to query the database (#__categories table) for the description etc.

Yves

Category description not shown when no events 7 years 5 months ago #35217

  • Brian A Peat
  • Brian A Peat's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
I need this same feature as my client wants to use the categories as course overview descriptions, and then list all the event/time slots that course is offered.

I'll see if I can figure out how to do it from your suggestion.

Category description not shown when no events 7 years 5 months ago #35218

  • Brian A Peat
  • Brian A Peat's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
I can't figure out how to grab the current category in order to get the correct description. Any help here would be appreciated.

AHA! I got it sorted out. I moved the whole if empty block above the bootstrap nav block so the pagination would be at the bottom, then in place of the COM_MATUKIO_NO_EVENTS_FOUND line I put this block:

$db = JFactory::getDBO();
$db->setQuery("SELECT description FROM #__categories WHERE id = ".$this->catid." LIMIT 1;");
$eventcatDesc = $db->loadResult();
echo $eventcatDesc;
echo JText::_("COM_MATUKIO_NO_EVENTS_FOUND");

Category description not shown when no events 7 years 5 months ago #35226

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Yep, looks fine :-)

But check if you have an id, it could be also that on the home page you have no events. ;)

E.g. if ($this->catid) ..

Yves

Category description not shown when no events 7 years 5 months ago #35230

  • Brian A Peat
  • Brian A Peat's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
I'm a bit of a hack when it comes to this. I can't believe I actually got this part to work at all honestly. If I get time, I'll try to add the if/then statement to it, but feel free to post something in here that you know will work :)

I wish I'd had time to talk to you at JWC, I have lots of questions about Matukio but I don't really want to flood the forums with them :)
  • Page:
  • 1
Time to create page: 0.128 seconds