Support

Home Forums Event Espresso Premium Different Template

Different Template

Posted: October 9, 2017 at 12:14 am


GSP

October 9, 2017 at 12:14 am

Hello,

I am new in Event Espresso and I’m trying to set up this extension with the template of my siteweb.

In fact, I have 3 different colored theme, the same architecture but different color. But that mean that I have custom template.

I have found where I can set up the “right” template for my event in the “Event page”.

I have done a test. It’s working great for choosing the right event, great when I select how many tickets a want to buy. But when I try to book my event, when the page where I need to fill up the fields with name, surname aso… arrive, I loose my template… the content are coming without template background.

I have seen that Espesso is using the index.php file. Of course I could change it and adapt the layout… but I would like to know how Espresso could choose the right template with my specific header and my footer. In the future, I am going to have other events with the 3 different templates…

Thanks for your help.

Best regards.


Tony

  • Support Staff

October 9, 2017 at 3:38 am

Hi there,

It’s not Event Espresso selecting the template for the output, its your theme.

If the registration-checkout page is using index.php to output the details, the you don’t have a template for pages (as that’s just a standard ‘page’ with our shortcode on it) and your theme is dropping back to index.php.

Take a look here for how the template hierarchy works in WordPress:

https://developer.wordpress.org/themes/basics/template-hierarchy/


GSP

October 10, 2017 at 5:53 am

Hi Tony,

Thanks for your answer.

I’ have done some changes…

Now it’s coming on the page.php … but the problem is the same.

I put the link of my development site

https://dev.pacinfo.ch/event/

probably to have a look inside is easier to explain.

But actually it’s working with the good template until the moment where I need to complete with “name, surname etc…”.

Can you explain me again?

Thanks a lot for your help.

Ph. Ranc


Tony

  • Support Staff

October 11, 2017 at 2:04 am

Have you set the events permalink to ‘event’?

Can you send me a copy of the theme so I can see what you have, please? You can use support[at]eventespresso.com to send the theme to me.


GSP

October 12, 2017 at 12:11 am

Hi again,

I have done some test and I understand better how EE4 is working.

I have found where I can choose the right template in the “General Settings”, Critical pages… but my problem is that when you choose a page for “Check-out”, it’s choosen for all the events…

I would like to habe specific template for each event.

In fact, I’m doing event for 2 associations. Each has a different color… and I would like to have the good template (with the good color) from the beginning to the check-out.

Do you have any other idea?

Thanks for your help.

Ph. Ranc


Josh

  • Support Staff

October 12, 2017 at 7:00 am

Instead of changing templates what you could do is set a custom class on the
<body> or <article> or other element, then set the different colors with CSS that target selectors that match the event’s category.

Here’s a code example you can follow:

https://gist.github.com/joshfeck/41ee6fed7fc60400e7db9c1be18f5aed

In that code example you’ll note that if it’s the registration checkout page, the code will grab the category slug of the event that’s in the cart, then it will add the category slug as a class to the <body> element.

You can add the above code to a functions plugin or into your WordPress theme’s functions.php file.

Then you set event to a specific category. Then you’ll be able to write CSS to change the look of the registration checkout page based on which event is in the cart.

The support post ‘Different 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