Home › Forums › Calendar Products › Events Calendar PRO › Different Template for Single Event View
- This topic has 5 replies, 3 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
October 10, 2012 at 11:00 pm #26457
Daniel
ParticipantI’m using ‘default page template’ for the events template in the settings for ECP. I’m pretty happy with how the calendar and list view look, but I’d like to use a different template for my single event view (mainly for the purpose of bringing in a sidebar). Any ideas on how I can do this? It appears you can only have one template for all three views.
October 11, 2012 at 6:44 am #26471Barry
MemberHi Daniel!
There are a few ways you might approach this. One is to have a conditional check in your page template that detects if the request is for a single event then loads another template in its place.
A second way would be to change the Events > Settings > Template > Events Template setting to “Default Events Template”.
You would also need to make sure that you had set up an events folder within your theme, containing at least:
- ecp-page-template.php which would be used to serve non-single event pages
- ecp-single-template.php which would be used for the layout of single events
There’s a stack of information on this stuff in our Themer’s Guide, Technical Documentation and we have helpful tutorials covering topics like template overrides (definitely worth looking at here).
The general idea would be to make ecp-page-template.php replicate the look and feel of your theme’s existing page template and the same for ecp-single-template.php, but add whatever bells and whistles you need here.
You may even find that these templates (if you copy them from the plugin’s views folder initially) do a pretty good job right out of the box at maintaining your theme’s look and feel.
I hope that helps but let me know if you need any further guidance.
October 11, 2012 at 8:33 am #26480Daniel
ParticipantSince I only know enough PHP to be dangerous, I might need some help getting started. I already have another template ready to go that I’d like to use for the single event page, so I think I wanna go the conditional check route. I can tell you the name of the template is ‘page-sidebar-right.php’ . How would I set up the conditional check?
October 11, 2012 at 9:58 am #26484Barry
MemberHow about a snippet like this? http://pastebin.com/5zUWqxJh
October 11, 2012 at 11:12 am #26495Daniel
ParticipantPerfect! Thanks for your help!
July 7, 2015 at 6:26 am #977975Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Different Template for Single Event View’ is closed to new replies.
