Different Template for Single Event View

Home Forums Calendar Products Events Calendar PRO Different Template for Single Event View

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26457
    Daniel
    Participant

    I’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.

    #26471
    Barry
    Member

    Hi 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.

    #26480
    Daniel
    Participant

    Since 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?

    #26484
    Barry
    Member

    How about a snippet like this? http://pastebin.com/5zUWqxJh

    #26495
    Daniel
    Participant

    Perfect! Thanks for your help!

    #977975
    Support Droid
    Keymaster

    This 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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Different Template for Single Event View’ is closed to new replies.