Where to edit meta output and labels?

Home Forums Calendar Products Events Calendar PRO Where to edit meta output and labels?

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #54864
    Marc
    Participant

    I want to add some classes to certain meta elements (for example 1) to differentiate between styling details, organizer and venue 2) to hide the entire ‘end time’ through CSS)

    I want to rename some labels for certain meta elements (for example 1) renaming ‘Event Tags:’)

    I want to add a Google Analytics gaq push to record an event when someone clicks the organizer outbound link.

    I was able to do this in the single.php template in 2.x. In 3.x, this seems to have been moved elsewhere. I found this, which is the meta.php file in public/advanced-functions:

    http://docs.tri.be/Events-Calendar/source-class-Tribe_Register_Meta.html

    This seems to be part of the core plugin files, not part of the customizable views. Would it work if you were to upload a custom version of meta.php at yourtheme/tribe-events/public/advanced-functions? I don’t want to edit the plugin files.

    #55442
    Barry
    Member

    Hi Marc,

    Sorry first of all for the delay in responding – we’ve been experiencing high levels of demand for support and that has unfortunately meant a few threads like this one have slipped through the cracks.

    Have you checked out our new themer’s guide? The ‘equivalent’ of 2.0.11’s single.php is single-event.php and it would now sit in a subdirectory of your theme called tribe-events rather than events.

    Does that help?

    #55456
    Marc
    Participant

    Thanks for getting back to me. I have looked at the themer’s guide, and I have gone through the single-event.php template. But that’s not where this stuff is housed.

    In 2.x each individual meta field was in the template file and I could edit there. In 3.x, it seems the meta fields get pulled from meta.php, which seems to be part of the core plugin?

    Do I edit the meta.php file? I assume not? But it looks like, if I want to edit the “Events tags:” output, I can find it here:

    http://docs.tri.be/Events-Calendar/source-class-Tribe_Register_Meta.html#289-300

    I don’t want to be editing the core plugin though… this should all be done through custom template files in /your-theme/tribe-events

    #55468
    Barry
    Member

    Right – there are many ways to do this.

    If you want to make some really quite drastic changes you could for instance remove the echo tribe_events_single_event_meta() call from within your single-event.php override and replace it with your own custom code.

    For something less drastic like changing the Event Tags label you can instead use a filter like this – and again avoid changing core plugin code.

    Does that help at all here?

    #55546
    Timothy Wood
    Participant

    Marc, I created a sample gist https://gist.github.com/codearachnid/6015326 with several ways to modify the meta per your inquiry. The new meta management class in TEC allows for customization of the meta ranging from labels, values, order and even setting the visibility based on views etc. I tried to hit all the items you were looking for in customizations so just let us know if this doesn’t work. Keep in mind you just have to put these changes in your functions.php file.

    #55558
    Barry
    Member

    Great stuff – definitely go with what Tim is suggesting in the first instance here Marc – Tim is one of the people who put this fine plugin together and his approach isn’t one I was aware of but definitely looks cleaner.

    #55568
    Marc
    Participant

    Cool. Thank you both. Looks like I have a little brushing up/learning to do, but it looks manageable to do. Thanks for the pointers.

    #55578
    Barry
    Member

    No problem πŸ™‚

    #57428
    nicolapiccinini
    Participant

    good morning
    I am facing a similar problem, which I can not give an answer;)
    wanting to hide the “event_meta” I went on the file the-events-calendar/views/single-event.php and i removed

    so everything is right, but…
    I recently activated wooticket to sell events through my woocommerce and I discovered that the box purchase wooticket is handled in the function event_meta …

    how to do, because I would like to keep hidden the event_meta?

    there is a shortcode wooticket can be inserted into the cms wordpress?

    otherwise, in which file can I go to make changes to code useful to suppress printing destination? in other words, keep the original code of single-event.php, so as to allow the operation of wooticket, but in doing so, the user side, does not appear no meta

    I hope to be able to clear up the problem πŸ™‚

    thank you!

    #57429
    nicolapiccinini
    Participant

    Ops… removes the code πŸ˜‰
    Was the event metΓ  code, about echo tribe_events_single_event_meta

    #57431
    Barry
    Member

    Hi nicolapiccinini –

    The best way to share code on this forum is to use a service like Pastebin or Gist and then drop the link in here. Unfortunately the forum software we’re currently using just isn’t very good at handling code.

    Was the event metΓ  code, about echo tribe_events_single_event_meta

    If all you removed was the following line then your ticket form should still be showing:

    <?php echo tribe_events_single_event_meta() ?>

    The “trigger” for the tickets form is actually this line:

    <?php do_action( 'tribe_events_single_event_after_the_meta' ) ?>

    That is also the hook which, by default, the related events section uses. To stop related events from showing you could follow the instructions in the second post in this thread:

    https://tri.be/support/forums/topic/getting-rid-of-related-events-or-at-least-the-big-grey-calendar-images/

    there is a shortcode wooticket can be inserted into the cms wordpress?

    I believe WooCommerce has an add-to-cart shortcode you might use.

    #57558
    nicolapiccinini
    Participant

    valuable, timely and decisive πŸ™‚
    thank you very much Barry!
    πŸ™‚

    #57572
    cakeandeatitdesigns
    Participant

    Hi,
    I am working on customizing the display of the event meta information for a theme I am building and I am trying to change the output of tribe_get_the_event_meta(). I have two main goals at the moment. First, I need to replace the dt, dl, and dd tags with tags from my custom theme. Second, I need to remove the h3 tags that start each section. I would like one section for all the meta information.

    I have found this http://docs.tri.be/Events-Calendar/source-function-tribe_get_the_event_meta.html#312-327 in the documentation. Which shows a filter being applied on like 326. ‘apply_filters(‘tribe_get_the_event_meta’, $html)’. I can’t find where the code for that filter is in the core plugin. I think I can use that as a starting point and create my own function to handle this, I just can’t find it. Unless there is a better way to handle this. Thanks for all the help!

    #58377
    Rob
    Member

    Glad to hear you’re sorted, marc!

    nicolapiccinini: thanks for the follow-up. Sounds like you’re set too.

    cakeandeatitdesigns: my apologies for the delay in getting you a reply here…this slipped through the cracks on our end. I’ll note that we can definitely provide more timely replies when new ideas/issues are posted in their own threads. To that end, would you mind creating a new one so we can close this technically-resolved issue down?

    We’ll do what we can to get you sorted from there. Thanks for your patience so far.

    #250501
    Jenn
    Participant

    Tim, I tried using the custom_event_meta() function you reference on gist, but it is not working for me. Since you posted that a year ago, I wanted to see if there was a better way to change the label in the Single Event Meta box for website?

Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘Where to edit meta output and labels?’ is closed to new replies.