Support

Home Forums Custom Files Add-on (EE3) Calling [EVENT_CUSTOM_VIEW] shortcode more than once in a single page

Calling [EVENT_CUSTOM_VIEW] shortcode more than once in a single page

Posted: June 12, 2014 at 1:08 pm

Viewing 2 reply threads


ctoravetz

June 12, 2014 at 1:08 pm

I’ve encountered an issue when using the [EVENT_CUSTOM_VIEW] shortcode more than once on a single page. Here is the page:
nyfamilylife.org/store/register

I’ve used used your instruction here for modifying the list template that comes in the Custom Template Add-on plugin.

I’ve then called the shortcode “[EVENT_CUSTOM_VIEW template_name=”mp-events-table”] three different times in the same page to create three separate lists that can be sorted.

The problem arises when I try to filter one of the lists, and the javascript causes the other 2 lists to filter as well. All three lists seemed connected or referencing the same table that is being sorted.

How do I make each list independent, so that I can sort one list without having the other listed automatically sorted as well?

Thanks for your help!


Tony

  • Support Staff

June 16, 2014 at 6:22 am

Hi Christopher,

I looked into this and found with a few modifications to the Custom Template Add-on and the events-table template this can be achieved.

If you want to use the same template multiple times then the easiest way to do this is with a shortcode attribute. So I would alter the shortcodes to have a unique identifier within each of them, so for example:

[EVENT_CUSTOM_VIEW template_identifier=”list1″]
[EVENT_CUSTOM_VIEW template_identifier=”list2″]

Then modify the template so that template_identifier can be within the event tables to make each unique.

I thought this would be a good addition to the events table template so included some code to do this within the default template. This will be included within the next update to the Custom Template Add-on.

However until that is released, here is a copy of the template I created to test this:

http://take.ms/IjXqX

You could use that as a base to work from until the update is released.

You’ll need to specify the template_name and another attribute called template_identifier. So your shortcode becomes

[EVENT_CUSTOM_VIEW template_name=”mp-events-table” template_identifier”list1″]
[EVENT_CUSTOM_VIEW template_name=”mp-events-table” template_identifier”list2″]

Etc

Does that help?


ctoravetz

June 16, 2014 at 8:24 am

Hi Tony,

I think that fixed it! Thanks so much.

Chris


Tony

  • Support Staff

June 16, 2014 at 10:06 am

No Problem 🙂

Viewing 2 reply threads

The support post ‘Calling [EVENT_CUSTOM_VIEW] shortcode more than once in a single page’ 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