Support

Home Forums Event Espresso Premium Editing templates in EE4

Editing templates in EE4

Posted: February 21, 2016 at 2:54 am


Chingy

February 21, 2016 at 2:54 am

Hi

I’ve tried checking the documentation and forum but am a little confused about how to go about editing the template for the single event page. As according to EE4 Theme Templates and Tags it looks like I copy over an archive page and use shortcodes.

Is there a template that I should copy into my child theme?

What I am trying to achieve, is to:

  1. modify the order and layout of the single event booking page
  2. remove the details which are shown in the event-datetimes > dashicons-calendar as this is not relevant (and misleading for my type of events)
  3. understand the location of the right template files to copy (if any)

Hope I’m not being a plonker am I missing


Lorenzo Orlando Caum

  • Support Staff

February 21, 2016 at 6:06 pm

Hi, there are some options available to help you make changes without custom coding via templates.

Login to your WP dashboard (WP-admin) and go to Event Espresso –> Events –> Templates. Turn the custom display option on. Then drag and drop to re-order the event elements.

It is available for the single event page and the events listing page.

Next, specific elements like the calendar dash-icons can be hidden with CSS.

For example, this CSS will remove the clock and the calendar dashicons from the datetimes area of the event pages:

.espresso_events .dashicons.dashicons-calendar, .espresso_events .dashicons.dashicons-clock { display: none; }

You can add new the styling to your child theme’s stylesheet or through a plugin like Reaktiv CSS builder or Simple Custom CSS.


Lorenzo


Chingy

February 22, 2016 at 12:16 am

Thanks

I feel the hide CSS option won’t be enough for what I need.

For example, I also want to remove/hide the show details + as this isnt necessary in my case and can complicate the process for my users.

The other thing reason for modifying the templates is that I want to make the pages for the event booking simpler/cleaner as my website templates are quite ‘design heavy’ and the booking pages should be simpler.

How do I go about customising the template please?


Tony

  • Support Staff

February 22, 2016 at 4:49 am

As according to EE4 Theme Templates and Tags it looks like I copy over an archive page and use shortcodes.

The archive template is used for the event list at /events/ so it depends what you want to edit which template you use.

For example, I also want to remove/hide the show details + as this isnt necessary in my case and can complicate the process for my users.

You can do that without modifying the templates, there is a setting for it within EE.

Event Espresso -> Events -> Template.

Set ‘Show Ticket Details?’ to No and save the settings.

The other thing reason for modifying the templates is that I want to make the pages for the event booking simpler/cleaner as my website templates are quite ‘design heavy’ and the booking pages should be simpler.
How do I go about customising the template please?

It all depends on what you want to change as to how in depth this gets, you’ll need knowledge of HTML, CSS, PHP, the WordPress template hierarchy and understand how the templates are being called within the theme.

At a basic level for the single event page, you’ll want to copy either your single.php template file, or your page.php template file depending on how your theme outputs both and which you prefer the single events to look like.

Most likely single.php

Then rename the copy to single-espresso_events.php

Your theme will then use your that template to display singe events.

Try reloading a single event now and confirm it works as expected and that template file is loading. Use a plugin such as what the file to confirm this.

From here it all depends on what you want to do so you’ll need to provide further detail. As it customization we can not provide support and walk you through your customisations but we can point you in the right direction.


Chingy

February 22, 2016 at 1:17 pm

Thanks. Thats kinda worked.

The single-espresso_events.php file worked perfect thank you.

However, it doesnt seem to insert this:
<div class="event-tickets" style="clear: both;">

Do I need to insert an additional bit of code into my template so that EE knows where to put the form?

A second idea (perhaps an alternative for me), but I could do probably get around what I want to achieve if I can do an if statement based on the page?

Something similar to…

<?php if ( is_page_template() ) : ?>
   Do this
<?php else : ?>
   Do something else
<?php endif; ?>

Is there a way for me to modify the above but for the single events page instead?

Thanks


Tony

  • Support Staff

February 23, 2016 at 2:21 am

Do I need to insert an additional bit of code into my template so that EE knows where to put the form?

You should not need to no.

Event Espresso injects the event details into the_content, as long as your template calls that it should work.

Is there a way for me to modify the above but for the single events page instead?

That code doesn’t do anything other than check if you in a page template, so I’m not sure what you would want to do with it.

single-espresso_events.php allows you to alter the single event output as is, you don’t need conditionals to do that.

Can you link me to the event so I can take a look please?


Chingy

February 23, 2016 at 2:46 am

Hi Tony

Thats what I thought – but seems odd. I’m using a bare bones Starkers theme as a foundation.

The conditional statement was just an idea in case I can’t get the template to work.

Can I send a private message with a URL to show you?


Tony

  • Support Staff

February 23, 2016 at 2:57 am

If its just a link you can send that to support[at]eventespresso.com
(Please include a reference to this thread so we know what it is for)

If we need login details to be able to view the site you can use:

https://eventespresso.com/send-login-details/


Tony

  • Support Staff

February 23, 2016 at 6:07 am

So whats happening is actually expected behavior on EE’s part although may seem a little odd at first.

A quick a explanation, is that when you take over the output using single-espresso_events.php Event Espresso assumes your taking complete control of the output and stops injecting details into the_content, what you see currently is the post content because your theme calls the_content() but EE is not injecting event details, datetimes, venus info etc.

I wasn’t sure if that’s were you were up to until I saw the video you provided.

You need to add this:

add_filter( 'FHEE__EED_Event_Single__template_include__allow_custom_selected_template', '__return_true' );

To your theme (or an Site Specific Plugin) to tell EE to continue to inject all of the event details into the_content whislt using single-espresso_events.php


Chingy

February 23, 2016 at 12:57 pm

Aha! That works now.

So… finally, if you can help. I

If single-espresso_events.php is the name for the single page, What do I need to name the template for handling the registration-checkout page please?


Tony

  • Support Staff

February 23, 2016 at 1:08 pm

Ah its not that simple.

Registration checkout is a standard page with a shortcode, it will most likely use page.php within your templates but that’s not a template specific to an EE page (like single-espresso_events.php) you could create a standard WordPress page template and set that to be used on that page.

That however is not going to give you control over the actual checkout forms etc, only the general layout of the page.

What are you looking to change?


Chingy

February 23, 2016 at 1:17 pm

Ah yes so it is. Gotcha. I’ve created a custom template and that works perfectly now.

(I was just trying to simplify the checkout page by removing all the branding and ads on that process – which I can do now with a custom template)


Tony

  • Support Staff

February 24, 2016 at 1:09 am

Great, I’m glad that worked for you 🙂

The support post ‘Editing templates in EE4’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 3 years, 9 months ago ago

Topic Tags

Tagged: 

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!