Support

Home Forums Event Espresso Premium Showing Category Descriptions When No Events Scheduled.

Showing Category Descriptions When No Events Scheduled.

Posted: February 8, 2013 at 4:26 am


mpurse

February 8, 2013 at 4:26 am

Hey guys,


mpurse

February 8, 2013 at 4:27 am

Sorry, must have hit submit too soon…

I want my category descriptions to show up, even if they are no events scheduled in that category. I am 99.9% sure that they did before the last upgrade.

What can I do to ensure they show?

Thanks.


Dean

February 11, 2013 at 3:57 am

Hi,

What method were you using to display the category descriptions?


mpurse

February 11, 2013 at 6:05 am

Category short code on page. See here for example:

http://www.thegoodlifecentre.co.uk/basic-carpentry/


Jonathan Wilson

February 11, 2013 at 1:19 pm

Hello,

Can you try: [EVENT_ESPRESSO_CATEGORY event_category_id=”your_id” show_expired=true]


mpurse

February 11, 2013 at 1:23 pm

Still the same I’m afraid.


Dean

February 11, 2013 at 11:57 pm

Hi,

Sorry I couldnt get back to you yesterday. I had a look at the code in question and there is nothing in place to display the description without an event being present.

You could possibly amend the shortcode to try and catch that there is no events and output the description anyway.


mpurse

February 12, 2013 at 2:51 am

OK, thanks will discuss with the developer. What’s strange is it was all displaying fine until the last update. Now we have empty landing pages. ๐Ÿ™


Dean

February 12, 2013 at 3:01 am

Hey,

What version were you running when it was fine? I’ll have a look at the code. It is possible some changes have occurred since that point.


mpurse

February 12, 2013 at 3:03 am

Hard to tell because the events have only just expired. But at a guess two versions back? Sorry if that’s not that helpful!


Dean

February 12, 2013 at 3:23 am

Hi,

No problem. I went back to version 3.1.27.1 so 3 large iterations a dozen or so small iterations and it wont display the descriptions if no events are available.

If you kept a copy of the original zip file you could work from that maybe, but you will still need some custom code work to get it to work


mpurse

February 13, 2013 at 4:31 pm

Hello guys, dev here.

I manage to get it work when i change event_list.php template to old one, but then for some reason shortcode that should list all events isnt working. Actually we had that problem after we did update, so fix was to use new event_list.php template. But as u can see, we have problem with category desc. not showing if no active events are in category. In the latest event_list.php file, i see this code on line 274

if ( count($events) < 1) {
        //echo $sql;
        echo __('No events available...', 'event_espresso');
    }

That is what shows instead of cat. description, I tried adding:

echo espresso_format_content($category_desc);

instead of "no events available" but no luck ๐Ÿ™ even if this code is working for events with at least 1 active event, which is few rows below.

if ($display_desc == 'Y') {
        echo espresso_format_content($category_desc); 

So as i can see that event_list.php file changed alot. Especially part where u pull data from DB. So is it possible that somewhere in that file u setup not to pull description if no event is in the system ?


mpurse

February 14, 2013 at 2:28 am

Mich here now. I just updated to the latest version and now none of the category short codes return events (even events with lots scheduled).


mpurse

February 14, 2013 at 2:52 am

UPDATE: I changed the short code on each of my category landing pages to: [EVENT_LIST category_identifier=XXXXX] and it worked a treat.

Will now check to see if that solves the issue of descriptions not showing when there are no events. Perhaps it does….


mpurse

February 14, 2013 at 3:06 am

Sadly it didn’t solve the “category not displaying when there are no events scheduled” problem. For now I have set up a work-around:

Extend the registration date of the last event out by a couple of months. Set registration numbers to 0 so no one can register. Set up wait list event. Assign wait list to the “dummy” event. It’s messy but works for now.

If a solution presents itself though, I’d be grateful to hear of it. These category landing pages are the key to our success.

Thanks.


Dean

February 14, 2013 at 6:13 am

Hi

>So is it possible that somewhere in that file u setup not to pull description if no event is in the system ?

Pretty much, I’m not in depth in the code changes that occur, but from what I could tell testing, if there are no events recorded for that category it doesn’t pull over anything.

I can only assume that the devs removed it as it was using resources unnecessarily not realising it was actually in use by someone.

I’m glad you have a workaround but yes its not simplistic is it. I’ll raise a ticket over it and see if I can get it put back in but if or when is an unknown.

The support post ‘Showing Category Descriptions When No Events Scheduled.’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso