How can I change the template for the Events and Bookings archive that is displayed from the shortco

I've tried to update the shortcode-archive-default.php in the default-templates directory but that hasn't changed anything. Any ideas where to look? Also, I'd like to use this as my own template and not have it overwritten by a future update so if you know how to do this as well I'd much appreciate it. Thanks!
Tom

    Jack Kitterhing

    Hi there Tom @thoward

    When creating a new template to use, copy the code of the template you want to edit, in your case shortcode-archive-default.php and place it in your themes root directory, but this won't I believe keep the changes for a future update, I would advise you to create a backup.

    Depending on what you wish to change, you may be able to edit the display of the events with the included shortcodes. Or the templates that come with the plugin, I've attached a screenshot.

    Also I feel this thread may be of help to you:
    https://premium.wpmudev.org/forums/topic/events-creating-a-custom-template

    Thanks!

    Kind Regards
    Jack.

    Patrick

    Hi @thoward

    Here's a great tip from the developer on how to create custom templates for Events+
    https://premium.wpmudev.org/forums/topic/events-creating-a-custom-template#post-362177

    I don't know if that will also affect the output of the shortcodes though.

    I'll alert the developer to this thread to see if he can provide some insight into this. As we are already at the end of the week, this may need to wait until next week though. Hang on...

    thoward

    Thanks for the suggestions. I really want to use the shortcode option on a custom page I created as I need to be able to show events further than 4 weeks out and I couldn't get the default archive to do that.

    So, I copied the shortcode-archive-default.php file to my theme folder and then edited it to test. There were no changes at all on the archive page - http://www.crmevangelist.com/upcoming-events/

    Here is my shortcode: [eab_archive weeks=52 lookahead="true" ]

    I noticed there is a "template" attribute that I could use here but no idea how to implement that.

    So, still need help. Thanks!
    Tom

    thoward

    If I use the template attribute to something like:
    [eab_archive weeks=52 lookahead="true" template="crme"]

    would that mean the template file for the archive shortcode is in the "crme" theme folder for the site - wp-content/themes/crme? OR in the "crme" theme folder for the plugin - wp-content/plugins/events-and-bookings/default-templates/crme/? OR somewhere else?

    Also, what would the name of the file be?
    shortcode-archive-default.php
    shortcode-archive-crme.php
    shortcode-archive.php (found via folder)

    Some documentation on shortcodes would really really be helpful here!
    Tom

    Vladislav

    Hello,

    I can see where the confusion comes from, so let me try to properly explain how the shortcodes templating works. By default, the shortcodes won't even bother with the templates, and will use the callbacks in the templating class instead (Eab_Template; this class can also be extended and overridden - that's a bit more advanced topic, but we can go there too if you want). If you wish to make the shortcodes use template files, you have to explicitly provide the "template" attribute in the shortcode. The value of the attribute should be the file name, without ".php" part.

    The plugin will first check your theme's root folder and use that if the file is found. Only if it can't find the file there, it will try to use the template from its own bank (default-templates/).

    In practical terms, say you have your template in a file named "shortcode-archive-crme.php" in your theme's root directory. You would then use a shortcode like this:

    [eab_archive weeks=52 lookahead="true" template="shortcode-archive-crme"]

    I hope this helps.

    Miriam

    I've a copy of the archive template in my theme folder (eab_list_event.php). I've added a bit of text to the template so I can tell it is my template that is in use, and it is. Otherwise the template is identical to default/archive-incsub_event.php

    The shortcode on my page is:
    [eab_archive weeks="1" relative_date="+1 day" lookahead="true" template="page-eab_list_event"]

    When my template is in use the page reports "no events".

    If I change the shortcode to remove the template:
    [eab_archive weeks="1" relative_date="+1 day" lookahead="true" ]
    it works and displays the events.

    What to do?

    Sajid

    Hi @Miriam

    Hope you are doing good today and welcome to WPMUDEV

    I can see this thread is already resolved and very old. Instead of spamming the user with emails please open your own thread so we can assist you separately.

    Posting in similar thread sounds good at first but leads to confusion and ends with no results at all. Always start separate thread for separate issues to get faster response and according to our forum posting rules.

    If a thread is related to your issue then post that thread link in your thread for reference.

    Thanks for understanding and being a member

    Cheers, Sajid

    Miriam

    Actually, the thread was marked closed by an admin with instructions to reopen the thread, so I don’t appreciate your lack of an answer or your tone. Read the thread I say.

    "I'm doing a bit of housekeeping by going through some older threads, and I noticed this one is still open.
    Just to get it out of our active ticket system, I'm going to mark it resolved.

    But if you still need assistance on this issue, please don't hesitate to re-open it by checking the "Mark as not resolved" box below.”

    So I didn't Hesitate, I did as instructed.
    Telling me to go jump through few hoops and then you will answer is rude and unfriendly.

    It is not resolved or answered at all. Bad marks to WPMU Dev for this response.
    Now how about a proper response?

    Miriam

    Sajid

    Hi @Miriam

    Hope you are doing good today

    So I didn't Hesitate, I did as instructed.

    Oh okay, so there is the confusion. Those instructions were for the member who originally started this ticket not for all other members of community.

    Actually we deal each individual ticket separately to avoid confusions. In cases we do need login credentials to dig deeper by logging in and going into members WordPress dashboard to get it fixed. Also each member issue and settings can be quite different then the other members.

    This also helps other members to find an appropriate answer for similar issues, while searching the forum in future.

    I am sorry if you did not like the way I requested you to open a new ticket, that was never my attention. I was just explaining how our system actually works and how we deal with each request. But again, please accept my sincere apologies for the confusion.

    Any way, I can take a look at if you post the content of your custom file here so I can test it on my own locally.

    Take care and have a nice day

    Cheers, Sajid