Enable Custom Field in Single Venue to open a Modal Window

Home Forums Calendar Products Events Calendar PRO Enable Custom Field in Single Venue to open a Modal Window

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1554862
    homeb1950aol.com
    Participant

    Hi. I am using the Events Calendar Pro, in which I created 10 venues. I use Popup Maker to create 10 modal windows; each modal window opens a specific PDF file that contains additional information about the venue.

    On each of the 10 Venue pages, I need to show a hyperlink that opens the specific modal window. I thought I could do this with one or more custom fields.

    Here is a sample Venue: http://pittsburghbowlerstour.com/venue/st-clair-lanes/. You’ll see the custom field blow the Featured Image.

    How do I structure the Value in a custom field and/or edit a template to make this happen?

    Thank you.

    #1555700
    Edward
    Member

    Hi there, thanks for reaching out to us!

    I think that what’s going on here is by default, most of the calendar views show excerpts that strip HTML content. Take a look at our article that gives some insight on why things are done this way → https://theeventscalendar.com/the-trouble-with-excerpts/

    By using our Themer’s Guide as reference, you can override the single-event.php and change the way that events are shown. (there are some good examples in that first link that talks about excerpts and why they are used)

    Once you have template overrides figured out, you can also integrate your custom fields and modal box features to require less work each time they are used.

    Hope that helps!

    Take care,
    Ed 🙂

    #1561197
    homeb1950aol.com
    Participant

    Thanks, Ed, but I am afraid I don’t understand your answer. I need to change the behavior in single-venue.php. I copied the file into my child theme and opened it in a text editor. Line 101 displays the featured image and line 106 displays Upcoming Events. There is no code between that displays custom fields.

    Perhaps I should clarify my need. For the venue named “St. Clair Lanes”, I create a custom field named “Hotels Nearby”. I need the value of this custom field to display as a hyperlink when a visitor displays this single venue. The target of the hyperlink is “#”. The class of the hyperlink is “popmake-567”, which is a shortcode used by Popup Maker to open a modal window with an ID of 567.

    Here is an example of the hyperlink:
    Hotels near St. Clair Lanes.pdf

    Can this be done? thank you.

    #1563500
    Barry
    Member

    Hi there, @homeb1950aol.com 🙂

    Sorry for any confusion! Yes, I’m sure that can be done — we’ll be happy to point you in the right direction if we can, but please note custom development tasks like this one largely need to be driven forward by you.

    Line 101 displays the featured image and line 106 displays Upcoming Events. There is no code between that displays custom fields.

    By copying that template (single-venue.php) to your theme – instructions on doing this and where to put the copy, which it sounds like you’ve already followed, can be found here – you can add some additional code to help with this, something like:

    <a href="#" class="popmake-567"><?php echo esc_html( get_post_meta( $venue_id, '_field_name', true ); ?></a>

    I’m unsure of the actual field name you used for the custom field, so you would need to adjust that. Does that help at all?

    #1580157
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Enable Custom Field in Single Venue to open a Modal Window’ is closed to new replies.