Support

Home Forums Event Espresso Premium Exclude Category from Accordion Template

Exclude Category from Accordion Template

Posted: May 8, 2014 at 2:30 pm

Viewing 7 reply threads


Jennifer Doyon

May 8, 2014 at 2:30 pm

Hello –

I entered the shortcode of [EVENT_CUSTOM_VIEW template_name=”category-accordion” exclude=”17″] where 17 is the ID of the category I want to exclude, but it is still showing in the accordion.

Thanks –
Jennifer


Lorenzo Orlando Caum

  • Support Staff

May 8, 2014 at 3:20 pm

Hello,

That parameter is for the event id. Here is an example of how to use it:

https://eventespresso.com/wiki/custom-template-add-on/#accordion


Lorenzo


Jennifer Doyon

May 8, 2014 at 3:22 pm

Hi, Lorenzo –

Before I purchased this add-on, I was told by EE support staff that I could exclude specific categories. If this is not the case, I will need a refund, because it will not be useable for my site.

Thank you –
Jennifer


Lorenzo Orlando Caum

  • Support Staff

May 8, 2014 at 3:49 pm

Hi Jennifer,

Let me check with some team members to see if we can adjust the parameter to look for categories instead of events.

Thanks.


Lorenzo


Tony

  • Support Staff

May 9, 2014 at 8:36 am

Hi Jennifer,

I’ve taken a look at the accordion template and it seems that functionality was intended to exclude single events rather than full categories.

A small code change is need to exclude the full categories.

Open up espresso-template-category-accordion/index.php on line 65 you’ll find:

$catcode = $category->id;

Make some space under that line and add:

if($exclude && in_array($catcode, $exclude, true)) {
	continue;	
}

That will remove the full category section although, say you have 2 categories ‘Cat 1’ & ‘Cat 2’.

If you exclude Cat 1, that ‘dropdown’ will be removed from the output, but events in both (for example) Cat 1 & Cat 2 will still be displayed within the Cat 2 dropdown. As by default they would be displayed in both sections.

If you prefer I can send you a copy of the accordion template with these changes to the email account linked with your account.


Jennifer Doyon

May 10, 2014 at 10:57 am

Hi, Tony –

This worked perfectly! As usual, EE support never ceases to be anything less than awesome.

One other question: If I include this template in the uploads/espresso/templates folder, will it prevent the file from being changed if the plugin is updated?

Thanks again!

Jennifer


Lorenzo Orlando Caum

  • Support Staff

May 11, 2014 at 4:23 pm

Yes, you can move a copy of the template to the templates folder to ensure that your edits aren’t lost on a software update.

Please see the guide at the end of this page:

https://eventespresso.com/wiki/custom-template-add-on/#cel_custom


Lorenzo


Jennifer Doyon

May 12, 2014 at 9:06 am

Thanks again!

Jennifer

Viewing 7 reply threads

The support post ‘Exclude Category from Accordion Template’ 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