Home › Forums › Calendar Products › Events Calendar PRO › template tags in tabs?
- This topic has 12 replies, 3 voices, and was last updated 10 years, 1 month ago by Barry.
-
AuthorPosts
-
March 18, 2014 at 2:18 pm #120852henkleParticipant
Hi,
Im trying to built own templates for single venue, single org, and single event.
Taking single-venue.php for example – i like to create a tab system where I include
1. Venue description (content)
2. Map (google embeded map)
3. List organizers related to that venue. (In my case artists)
Tabs working fine with plain text, and Last one (3) works fine using a shortcode. However – i can’t figure out how i should call the content and the map (1 and 2) within the tabs to make it display. It looks like this, and i insert the template tags i like to display. (which displays fine outside tabs) Please advice…<?php
$t = ‘[tabgroup title=””]
[tab title=”About”]
<?php the_content(); ?>
[/tab]
[tab title=”Map”]
<?php echo tribe_get_embedded_map(); ?>
[/tab]
[tab title=”Artists”]
[subposts_show_childs slug=”gallery-artists” link=”true” excerpt=”true”]
[/tab]
[/tabgroup]’;
echo do_shortcode( $t );
?>Im using Flatsome Theme if of interest.
March 19, 2014 at 9:23 am #121098BarryMemberThat sounds like a great idea.
We’d love to help further but I’m afraid it’s just a little out of the scope of what we can assist with.
March 19, 2014 at 12:22 pm #121214snortonParticipantI don’t work for Modern Tribe, so maybe I can help 🙂
Try this (just remember that if you change your theme down the road you’ll find that this will give you an error):
echo do_shortcode('[tabgroup title=""][tab title="About"]' . the_content() . '[/tab][tab title="Map"]' . tribe_get_embedded_map() . '[/tab][tab title="Artists"][subposts_show_childs slug="gallery-artists" link="true" excerpt="true"][/tab][/tabgroup]');
Is your tabgroup title supposed to be blank?
What if you choose not to display the map? You’ll want a variable to check if the map has been enabled in the event before outputting the tag I’d imagine:if (tribe_embed_google_map()) {$maptab = '[tab title="Map"]' . tribe_get_embedded_map() . '[/tab]'; }; echo do_shortcode('[tabgroup title=""][tab title="About"]' . the_content() . '[/tab]' . $maptab . '[tab title="Artists"][subposts_show_childs slug="gallery-artists" link="true" excerpt="true"][/tab][/tabgroup]');
March 19, 2014 at 2:25 pm #121239henkleParticipantMan, thanks. Worked like a charm!!
(If someone else look at this – note that i forgot get before the content. Should be get_the_content.)A follow up thing though, if you have time – the content is displayed without formatting – i.e. all text in a row – no paragraphs. Any idea why, and/or how to fix that…?
Again – thanks a million!
March 19, 2014 at 2:36 pm #121244snortonParticipantCare to share a link? I’ll take a quick look and see if there’s anything obvious that may be causing that.
March 19, 2014 at 2:44 pm #121248henkleParticipantThis reply is private.
March 19, 2014 at 2:51 pm #121255snortonParticipantSorry @henkle, while I can understand why you wouldn’t want to publish a link, I cannot view what you’ve marked as private. That’s a feature available only to the Tribe folks.
March 19, 2014 at 2:55 pm #121257henkleParticipantSorry, very much under construction though:
http://artgoons.com/venue/galleri-hera/
You need a password: nyfikenBtw – when i have your attention – and you seem to know what you’re doing – is this as complicated as Barry says – or is it worth looking into? https://tri.be/support/forums/topic/photo-view-listing-in-all-listings/#post-121146.
March 20, 2014 at 6:25 am #121428snortonParticipantTry wrapping your content in the wpautop() function. It’s possible that your theme has removed the wpautop with a filter.
March 20, 2014 at 7:12 am #121467henkleParticipantThanks @snorton
hm.. yes, inserting paragraphs in the content works. But no, do not want to do that.
So – this wpautop – how would that best be implemented? Not sure where to apply it and how…I’ll stop harassing you after this… promise. 🙂
March 20, 2014 at 8:40 am #121528snortonParticipantNo worries. I can’t say with 100% certainty that this will work without actually seeing the theme files, but in my above code, replace
the_content()
with
wpautop(the_content(),true)
Refer to the WordPress Codex for the wpautop function
March 20, 2014 at 8:51 am #121532henkleParticipantOf course it did…
You saved my day!
Thanks again.April 18, 2014 at 6:37 am #136170BarryMember(… to keep things tidy, I am now closing the thread!)
-
AuthorPosts
- The topic ‘template tags in tabs?’ is closed to new replies.