Customize the Event Template

Home Forums Calendar Products Events Calendar PRO Customize the Event Template

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #103657
    James
    Participant

    I want to rearrange things a bit in the template. I can find the file, but I’m not sure how to pull out only some of the meta details and relocate them. You can see that the event I’ve created has an custom meta field “non-member price.” I also want to USE the website field to create a “buy now” button.
    http://fwatest.org/event/ein-feb-brew-ary-fest/
    I’m no PHP master, but I know my way around an am pretty comfortable with doing changes like this.

    #104133
    Brook
    Participant

    Howdy jamesdonegan,

    I would happy to help here. It sounds like you have already familiarized yourself with our themer’s guide. If not please do so as this is some necessary knowledge for accomplishing what you want.

    The easiest way to do that is to create an override for the single-event.php file, by placing this snippet in your text or code editor, and saving that file to [your-theme]/tribe-events/single-event.php. You will see the individual meta groups in that file, and you can rearrange as needed.

    Does that all make sense? I tried to make things as easy as possible with my snippet, but it still does require a fair amount of PHP knowhow and some familiarity with our themer’s guide. So, if you lack a completeness in regards to either of those, it might not be possible without hiring a developer.

    Please let me know if that helps. Cheers!

    – Brook

    #104137
    James
    Participant

    Thanks for your response, but I’d already done what you suggested, and it’s not what I need.

    I have already created the new single-event.php file in my theme directory. That’s fine. What I need to “get inside” is this area:
    <?php echo tribe_get_meta_group( ‘tribe_event_group_custom_meta’ );?>

    If you look at the link I gave in my first post, you’ll see there is one “standard” field – website – and one custom field – non-member-price – both of which I need to remove from that meta area. I want to make the link into a “register now” button and move the non-member price up beside the member price in the heading area. (In fact, you can see that I’ve already customized this file by having it display “Member Cost:” in the heading area.)

    Thanks for your assistance!

    #104323
    Brook
    Participant

    Howdy jamesdonegan,

    Ahh, I follow you now! This will be easy to do using TribeEventsCustomMeta::get_custom_field_by_label(); Here is an example:
    echo TribeEventsCustomMeta::get_custom_field_by_label("Non-Member Price");

    That will return the value of your non member price field. The Label can be output separately, as a heading or however you prefer. Does that code work for you?

    – Brook

    #104523
    James
    Participant

    Almost!!
    How can remove it from the place where it WANTS to display? I know I can edit the meta.php file, but I fear that will be replaced when I run an update. And I don’t see in your support where to save a new meta.php file in my theme.

    Thanks!

    #105434
    Brook
    Participant

    Howdy again,

    You are welcome! If you want to remove a Custom Meta item from the default listing (which is output by the meta walker), checkout our documentation on the Meta Walker. Specifically it sounds like you would want to use the function tribe_set_the_meta_visibility() to hide it.

    Did that work? Are you able to complete the modification now?

    – Brook

    #106470
    James
    Participant

    SO SO SO SO SO CLOSE. Thank you.
    So now I’ve tried to move the website link up using this code:
    ” target=”_blank”>Register Now!

    But it links not to the event website as defined in the event, but rather to the current Events Calendar page. (So, in other words, the “website” field in the event is filled in with “www.ABC.com” and the event page in MY site is “www.XYZ.com”, the link is sending to XYZ.)

    See it in dis-action here: http://fwatest.org/event/ein-feb-brew-ary-fest/

    I know it’s my relative lack of PHP experience (I’m not a total novice, but I’m certainly a beginner) that’s making this harder than it has to be, but I really appreciate your help.

    #106686
    Brook
    Participant

    By the way I am sorry this topic was closed by accident, you are the first to mark a thread as answered while still wanting to continue the conversation.  We are changing that autoclose on answered behavior very soon. Feel free to continue the conversation here, or in your other topic. Whichever you prefer.  Thanks!

    – Brook

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Customize the Event Template’ is closed to new replies.