how to pull in venue and organiser details on single event page

Home Forums Calendar Products Events Calendar PRO how to pull in venue and organiser details on single event page

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1027070
    tony
    Participant

    At the moment the venue and organiser details are pulled in via a link on the single events page in the box at the bottom of the page. This then requires the user to click on the link and go to another page to view the information.
    I have created a custom single event template and want it to automatically pull all of the information about the venue and the organiser into the main content section, rather than just pulling in the link to these pages in the summary box at the end of the single event page.

    Can you give me a heads up on whether this is possible and how I might achieve it?
    Many thanks! Susan

    #1027133
    Geoff
    Member

    Hey Susan and welcome to the forums!

    I’m stoked to hear you made a custom event template–nice work. 🙂

    The venue and organizer details are available in a handful of functions you can use to echo the data in the template. There are quite a few for each, so here are some results from our documentation to get you started:

    Let me know if you need help looking for a specific function and I’d be happy to help as best I can!

    Cheers,
    Geoff

    #1027561
    tony
    Participant

    Thanks for this Geoff. I’d be really grateful for a bit more help if that’s OK – afraid I’m only a beginner with php. So, specifically what I am looking to pull into the single page content is the featured image and content about the venue – rather than the information input into the information fields. Similarly with the organiser.

    Have looked at some of the template tags from your documentation – thanks for pointing these up. So I tried tribe_get_venue_details but not sure how to call this in the single event template. Tried <?php tribe_get_venue_details(); ?> but nothing happened so am guessing this is incorrect? Could you point me in the right direction with this – thanks so much. Susan

    #1027572
    Geoff
    Member

    Hi Susan and thanks for following up!

    Ah yeah, you can echo the functions in the template to return those values. So, for example:

    <?php echo tribe_get_organizer_website(); ?>

    …and that would return the organizer’s website URL.

    Let me know if that helps do the trick. 🙂

    Geoff

    #1027581
    tony
    Participant

    Ah yes! Using echo pulled something into the page. So the code you provided pulled in a url (unlinked) to the organiser page on the website. What I would like to do is to pull in the actual content of that page – including the featured image. And likewise for the venue.

    In terms of venue content, I tried <?php echo tribe_get_venue_details(); ?> but nothing showed up except the word “array”. Apologies if these are really basic questions.

    Susan

    #1027662
    Geoff
    Member

    No worries, Susan! I’m totally happy to help as best I can. 🙂

    You probably need to grab the venues for the event and then call the details from there. For example:

    https://gist.github.com/geoffgraham/fc34482b5584f6da3972

    Let me know if that example helps!

    Geoff

    #1027839
    tony
    Participant

    Hi again Geoff, thanks for your continued assistance.

    So yes, that code pulls in some of the meta details. But what I am after is the actual post content. So the equivalent of <?php the_content(); ?> for venue and organizer pages. I have had a look at venue.php and couldn’t see anything in that template file that seemed to pull in the content that I could grab and paste into my custom single-event.php. Likewise with organiser.php. Any ideas? Thanks! Susan

    #1028109
    Geoff
    Member

    Oh gotcha! Sorry, I must have misunderstood–thanks for clarifying.

    Venues and Organizers actually use the_content() just like any other WordPress post. So, if you want to grab the content for a particular venue, you can call for the content in the same loop where the Venue/Organizer is being queried.

    A good example is looking at the single-organizer.php and single-venue.php templates. Those can both be found in the Events Calendar PRO plugin files under /src/pro/views. Open those up and you will see how the venue is both queried and where the_content() is called to display the post content.

    Does this help a little more? Please let me know!

    Geoff

    #1029046
    tony
    Participant

    thanks for your continued help with this Geoff. So I found the relevant template files but afraid I’m having some difficulty identifying the right bit of code to call in my single-event.php file. I tried Inserting this bit of code, but it simply called the content of the single event, not the venue.
    <!– Venue Description –>
    <?php if ( get_the_content() ) : ?>
    <div class=”tribe-venue-description tribe-events-content entry-content”>
    <?php the_content(); ?>
    </div>
    <?php endif; ?>
    I’m probably missing something really obvious, sorry, but would appreciate a bit more help. Many thanks! Susan

    #1030445
    Barry
    Member

    Hi Susan,

    I wanted to drop by since Geoff is largely out this week and you’ve been waiting a few days already 🙂

    The problem with using either get_the_content() or the_content() in this situation is that both assume you are interested in the current post. In the context of a single event view, that means the event itself, not the venue or organizer.

    However, you can certainly obtain and display them by doing something like this:

    echo apply_filters(
        'the_content', 
        get_post_field( 'post_content', tribe_get_organizer_id() )
    );

    That arguably isn’t the preferred way – but it will probably do the trick for you in this specific case. Note you can swap out tribe_get_organizer_id() with tribe_get_venue_id() to get the venue description.

    Last but not least, though we’re more than happy to steer you in the right direction if we can, I do want to highlight that there is a limit to the amount of customization support we can offer. It is also important you understand changes like these sufficiently well to be able to maintain them yourself in future.

    With that in mind, it might be that you prefer to work with an independent developer/designer if you think you’re going to need further assistance with these items – check out this useful list of folks who might be able to help further if so 🙂

    Does that help?

    #1033912
    tony
    Participant

    Thanks for all your help with this Barry and Geoff. Really appreciate it! Hope you guys had a great thanksgiving celebration. Susan

    #1034100
    Geoff
    Member

    Right on and thanks for following up, Susan! Hope you had a great Thanksgiving as well and thanks again for getting in touch. 🙂

    Cheers,
    Geoff

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘how to pull in venue and organiser details on single event page’ is closed to new replies.