Using additionnal field inside a template

Home Forums Calendar Products Events Calendar PRO Using additionnal field inside a template

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1119645
    Guillaume
    Participant

    Hello,

    I need to modify some element in modules/meta/details.php to insert some additionnal fields inside it.

    I created my additional fields, they appear at the bottom of the column. I would like to use them in details.php but I can make it appear.

    What I basicly need to do it to write some text in the template (click here) and use the additionnals URL field as link to make it look like : Click here

    Thanks for your help !

    #1119927
    Geoff
    Member

    Howdy Guillaume!

    You should be able to grab any and all of your custom fields and use them in a template using this format to fetch the custom field by label:

    Tribe__Events__Pro__Custom_Meta::get_custom_field_by_label( $label, $eventID );

    So, for example, if you have a custom field called “Theme” then you could grab that like this:

    <?php Tribe__Events__Pro__Custom_Meta::get_custom_field_by_label( 'theme', $eventID ); ?>

    Will this help you get started? Please let me know. 🙂

    Cheers!
    Geoff

     

    #1120579
    Guillaume
    Participant

    Hello,

    Thanks for your answer, but it’s not working.

    I added this code inside ‘details.php’ and the content is not appearing in the frontend. (The name of my custom field is urlbilleterie

    <?php Tribe__Events__Pro__Custom_Meta::get_custom_field_by_label( ‘urlbilleterie’, $eventID ); ?>

    #1120661
    Geoff
    Member

    Oh shoot, I noticed a typo — sorry about that!

    This worked for me:

    <?php echo Tribe__Events__Pro__Custom_Meta::get_custom_field_by_label( 'Dress Attire' ); ?>

    Geoff

    #1120743
    Guillaume
    Participant

    It’s working ! Thanks 🙂

    #1121136
    Geoff
    Member

    My pleasure. Thanks again for getting in touch and for using Events Calendar PRO. 🙂

    Geoff

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Using additionnal field inside a template’ is closed to new replies.