Home › Forums › Calendar Products › Events Calendar PRO › Customize the Event Template
- This topic has 7 replies, 2 voices, and was last updated 12 years, 2 months ago by
Brook.
-
AuthorPosts
-
February 12, 2014 at 5:41 am #103657
James
ParticipantI 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.February 13, 2014 at 6:51 am #104133Brook
ParticipantHowdy 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
February 13, 2014 at 7:11 am #104137James
ParticipantThanks 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!
February 13, 2014 at 4:37 pm #104323Brook
ParticipantHowdy 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
February 14, 2014 at 10:04 am #104523James
ParticipantAlmost!!
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!
February 17, 2014 at 9:03 am #105434Brook
ParticipantHowdy 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
February 19, 2014 at 8:38 am #106470James
ParticipantSO 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.
February 19, 2014 at 2:48 pm #106686Brook
ParticipantBy 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
-
AuthorPosts
- The topic ‘Customize the Event Template’ is closed to new replies.
