Button with external link on event list page, on a per event basis

Home Forums Calendar Products Events Calendar PRO Button with external link on event list page, on a per event basis

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1289383

    Hello experts, 🙂

    I am wondering if this is possible: for some events we want to have a button displayed on the events list page. That button should link to an external source, where people can buy tickets for that event. On the events detail page we have that button integrated with HTML (example: http://knabenstimmen.mynews.de/veranstaltung/sommerkonzert/), but on the list page that does not work.

    Questions: is this possible with the current version of Events Calendar PRO? If so, how? If not, is there any workaround for that?

    Thanks in advance for any help of idea. 🙂

    Best wishes,

    Stefan

    #1289712
    Geoff B.
    Member

    Good evening Stefan and welcome to the Events Calendar Support forum!

    Thank you for reaching out to us.
    I would love to help you with this topic.

    The answer to that question is yes.
    You can pretty much tweak any view you like (and steal code from other views) using template/view customizations.

    You might want to read our Themer’s guide to get a sense of how that works.

    Additionally, you will want to read this article: https://theeventscalendar.com/knowledgebase/url-as-word-button/

    So in short, the best way to achieve your goal is to:

    1. Use the Website Event URL field (or something equivalent)
    2. Turn that into a button
    3. Move it around in the single event view if you want
    4. Steal that code and add it to the list view
    5. Upload your modified files back in your theme’s  /tribe-events/ folder

    Let me know how that goes.

    Best regards,
    Geoff B.

    #1289738

    Thanks for the quick reply, Geoff.

    We found a way to get that working fine. As we are using a custom field for each event to store an ID which is required for the button’s link, we want to have the custom fields hidden on the event’s detail page. I found this

    https://theeventscalendar.com/knowledgebase/hide-all-custom-fields/

    to hide the custom fields, but: problem is that the fields are hidden because that function returns ‘nil’ for the array of custom fields. That means that the custom fields are actually ‘deleted’ in order to hide them. That is OK if you really don’t need the fields on that page, but if you do need them, then this is not a solution.

    Question: isn’t there any other way to hide the custom fields from the single event page? We need the custom fields and don’t want them to be killed just to hide them… Where exactly in the single-event.php template file are the custom fields loaded? I can’t find that… Or would I have to hide them via CSS?

    Thanks,

    Stefan

    BTW: an option for each custom field to hide/show it on the event’s details page would be something for a future version, as I believe that custom fields are pretty often used to store something internal…

    #1290641
    Geoff B.
    Member

    Good evening Stefan,

    Thank you for writing back.

    We found a way to get that working fine. As we are using a custom field for each event to store an ID which is required for the button’s link, we want to have the custom fields hidden on the event’s detail page.

    Actually, this is a pretty good idea.

    However, if you are going to use Additional Fields for that purpose, I would recommend using actual WordPress custom fields (or a mix of them with Additional fields).

    The main advantage of using WordPress custom fields is that they do not display by default (unless you actually program them to).

    Question: isn’t there any other way to hide the custom fields from the single event page?

    Yes, you could either tweak the different view templates to your liking (via a template customization using our Themer’s guide).

    … Where exactly in the single-event.php template file are the custom fields loaded?

    Actually, they are located in /wp-content/plugins/events-calendar-pro/src/views/pro/modules/meta/additional-fields.php

    Or would I have to hide them via CSS?

    That would also be possible.

    But unless you are willing to use relative element CSS, I would ensure that each additional field gets assigned it’s own CSS class in your template override.

    BTW: an option for each custom field to hide/show it on the event’s details page would be something for a future version, as I believe that custom fields are pretty often used to store something internal…

    That is a very interesting idea. Thanks, I will share it with our Dev team.

    Let me know if that helps.

    Have a great day!

    Geoff B.

    #1290661

    Thanks a lot, Geoff. That really helped a lot! 🙂

    Best wishes,

    Stefan

    #1290951
    Geoff B.
    Member

    Good afternoon Stefan,

    I am super stoked that this was helpful to you!

    You are welcome back in our support forums any time 🙂

    For now, I am going to close this thread.

    Have a great week!

    Geoff B.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Button with external link on event list page, on a per event basis’ is closed to new replies.