Home › Forums › Calendar Products › Events Calendar PRO › single-event template overide
- This topic has 10 replies, 4 voices, and was last updated 12 years, 3 months ago by
Brook.
-
AuthorPosts
-
January 7, 2014 at 4:20 pm #88029
Ken
ParticipantI am running 2.x and ready to update to 3.x on my live site. I have a devsite already up-to-date with the new version and for the most part like the new css with 3.0. But I do not care for the new layout on the single-event page.
I notice now that the event detail is called in a function.
tribe_events_single_event_meta()How can I arrange this function to have my details formated how I want?
In particular I have some custom fields “Time Zone” and “Duration” that I want to appear under start time (I’m not using end time) instead of under the “Other” heading as well as not wanting to use some of the “Organizer” details.
With the old template it was relatively easy to remove the rows out of the table we didn’t use. Now at least for the time being its a bit more obscure. Hoping you can shed some light my way.
January 8, 2014 at 11:04 pm #89085Brook
ParticipantHowdy financialtools,
I think you will find this link helpful. That will show you the html and various functions used to display the meta fields. You should be able to copy the HTML and PHP from that function into your template over-ride, in place of the tribe_events_single_event_meta() call. Then, just remove the bits you do not want as you did before.
I am glad you have been able to update your theme thus far. I hope you have found the new API easier to use.
Does that make sense? Is that going to work for you? Thanks!
– Brook
January 9, 2014 at 8:28 am #89314Ken
ParticipantHey Brook,
Thanks for the resource. I do see how that section of the code used the function to build the page. What I guess I don’t get is how the functions within the function above display the info.
tribe_get_meta_group( 'tribe_event_details' )
tribe_get_meta_group( 'tribe_event_venue' )
tribe_get_meta_group( 'tribe_event_organizer' )I believe is the one that brings in all the details?January 9, 2014 at 8:33 am #89317Ken
ParticipantThis reply is private.
January 10, 2014 at 11:03 am #90213inhouse
ParticipantHey @ken, I’m wondering the exact same thing. Have you made any progress with this? I replaced tribe_events_single_event_meta() in my functions file but there are other functions nested within that really alter the finer details. I need to be able to customize the event “Details” output but am not really seeing anything specific. The tribe_get_meta_group function doesn’t include any specific HTML to customize that I can see thus far.
January 10, 2014 at 11:50 am #90226snorton
ParticipantYou guys can call each specific meta item individually that you would like to display in your template override. Check out the tribe_get_ series of tags you can use in your template with the ECP docs.
http://docs.tri.be/Events-Calendar/Then you can just use whatever HTML you want.
example:<?php $venue = tribe_get_venue(); if(!empty($venue)) { echo '<h4>Venue</h4>' . $venue . '<hr />'; } ?>January 10, 2014 at 11:33 pm #90421Brook
ParticipantHowdy all,
Snorton’s advice is spot on. In addition Ken, to display your custom fields like timezone you can use one of the following functions:
tribe_display_meta_group('tribe_event_group_custom_meta');
tribe_display_meta('tribe_event_custom_meta');
Is this starting to make sense? By replacing tribe_events_single_event_meta() with all of these individual functions you do get full control over what data displays and the order of it. We have a million tribe_get_ functions for the individual fields, and Snortons link will show you all of them if you scroll down a bit in the left hand column.
Let me know if I can help further. Thanks!
– Brook
January 13, 2014 at 1:21 pm #91408Ken
Participant@Brook & @snorton
Thanks for your inout. I was actually headed down that path and your reply confirmed it. I think that I have all that I need except for one thing.
I want to list the categories that are linked to the event posted. When I use the function:
echo tribe_get_event_categories();I get an unsorted list of links. Is it possible to display those links in a comma separated definition list “<dl>”
@inhouse
the code snorton provided is spot on. Here is a sample that I am using:<dl> <?php $start = tribe_get_start_date(); if(!empty($start)) { echo '<dt>Date/Time</dt><dd>' . $start . '</dd>'; } ?> <?php $zone = tribe_get_custom_field('Time Zone'); if(!empty($zone)) { echo '<dt>Time Zone</dt><dd>' . $zone . '</dd>'; } ?> <?php $duration = tribe_get_custom_field('Duration'); if(!empty($duration)) { echo '<dt>Duration</dt><dd>' . $duration . '</dd>'; } ?> <?php echo tribe_get_event_categories(); ?> <?php $venue = tribe_get_venue(); if(!empty($venue)) { echo '<dt>Venue</dt><dd>' . $venue . '</dd>'; } ?> </dl>January 13, 2014 at 2:01 pm #91443snorton
Participant@ken, to answer your question about displaying the categories as a definition list, you’ll want to go ahead and use:
echo tribe_get_event_taxonomy($post_id,'before=<dd class="tribe-events-event-categories">&sep=</dd><dd class="tribe-events-event-categories">&after=</dd>'); // Classes added to allow for stylingNot sure why there’s two functions to call the category/taxonomy, but I just find tribe_get_event_taxonomy easier to add the html $args to.
If you’re wanting a comma-separated definition list, you’ll need to tweak this… I thought the proper structure for a dl list is:<dl> <dt></dt> <dd></dd> </dl>or:
<dl> <dt></dt> <dd></dd> <dd></dd> <--! etc., etc. --> </dl>January 13, 2014 at 2:29 pm #91493Ken
ParticipantThat is odd but following your example I was able to get the comma separated list of categories.
echo '<dt>Categories</dt><dd>' . tribe_get_event_taxonomy( $post_id, 'before=&sep=, &after' ) . '</dd>';
You do have the proper structor of the DL but client wants the categories comma separated.January 13, 2014 at 4:06 pm #91666Brook
ParticipantHowdy Ken,
You have been getting some good advice thus far from Snorton. You might be able to add a comma where needed using css, something like dd:after{content:”,”}.
Sadly, there is a limit to the amount of support I can provide, especially when it gets down to small styling details. Basically it falls outside of Tribe’s scope of support. I hope you did get everything worked out though. Please let me know once this topic is resolved so we can mark it as such, or just click the Resolved/Answered button. Thanks!
-
AuthorPosts
- The topic ‘single-event template overide’ is closed to new replies.
