• Hi,

    I was wondering, if there exist any template tags and / or public EM_Event class methods for single event items which are equivalent to the placeholders used in the plugins template settings?

    If so, where is API documentation available?

    I am looking for something like $EM_Event->get_eventlocation, em_get_eventlocation(), $EM_Event->get_startdate or em_get_eventstartdate(), etc. …

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter bunjip

    (@bunjip)

    Hi @caimin_nwl,

    Thanks for your reply. In a way, that’s what I’m looking for. I’ve come across this page before. However, when I insert placeholders in my custom template, they won’t work. That’s why I assumed there might be ‘regular’ template tags available, too.

    I copied wp-content/plugins/events-manager/templates/templates/event-single.php to wp-content/themes/mytheme/plugins/events-manager/templates/event-single.php to override the default template for a single event view.

    As the original template replaces ‘the loop’ with custom class methods to retrieve data, I tried both ways in my template:

    a) without the loop:

    <h1>#_EVENTNAME</h1>

    b) within the loop:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h1>#_EVENTNAME</h1>
    <?php endwhile; endif; ?>

    However, #_EVENTNAME never gets parsed but rather the plain string just echoed out. What am I doing wrong with placeholders in custom template?

    Thanks!

    • This reply was modified 7 years, 11 months ago by bunjip.

    To use them in this way, you need to use the WordPress do_shortcode function. Like this:

    do_shortcode('[events_list]#_EVENTNAME[/events_list]);

    https://developer.www.ads-software.com/reference/functions/do_shortcode/

    Thread Starter bunjip

    (@bunjip)

    Alright,

    Thanks again. So does that mean, that Event Manager doesn’t come with actual template tags, that could be used in a custom template to retrieve event data?

    It still leaves me puzzled, how to write a custom event template with EM means. I’m still wondering what a (complete) template would look like for a single event view with EM shortcodes / placeholders / template tags in action. Is there an EM’s way to create such?

    • This reply was modified 7 years, 11 months ago by bunjip.

    There aren’t any template tags that resemble things the the_content(), the_permalink() etc.

    The idea is that you can use do_shortcode to include any Events Manager shortcode or placeholder without reinventing the wheel, or you can use 100% custom code by using PHP, WP_Query, etc.

    Thread Starter bunjip

    (@bunjip)

    Okay, slowly I think I’m getting what you’re saying. Sorry for being a bit resistant. It doesn’t feel very intuitive to me to retrieve data for custom templates with shortcodes and placeholders in ‘layout arrays’.

    However, in the meantime I stumbled upon this page. This object based approach resonates much more with me at the moment. If only there was an API documentation available… ??

    • This reply was modified 7 years, 11 months ago by bunjip.
    • This reply was modified 7 years, 11 months ago by bunjip.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Single event template tags or public methods equivalent to place holders?’ is closed to new replies.