template tags in tabs?

Home Forums Calendar Products Events Calendar PRO template tags in tabs?

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #120852
    henkle
    Participant

    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.

    #121098
    Barry
    Member

    That 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.

    #121214
    snorton
    Participant

    I 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]');
    #121239
    henkle
    Participant

    Man, 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!

    #121244
    snorton
    Participant

    Care to share a link? I’ll take a quick look and see if there’s anything obvious that may be causing that.

    #121248
    henkle
    Participant

    This reply is private.

    #121255
    snorton
    Participant

    Sorry @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.

    #121257
    henkle
    Participant

    Sorry, very much under construction though:
    http://artgoons.com/venue/galleri-hera/
    You need a password: nyfiken

    Btw – 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.

    #121428
    snorton
    Participant

    Try wrapping your content in the wpautop() function. It’s possible that your theme has removed the wpautop with a filter.

    #121467
    henkle
    Participant

    Thanks @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. 🙂

    #121528
    snorton
    Participant

    No 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

    #121532
    henkle
    Participant

    Of course it did…
    You saved my day!
    Thanks again.

    #136170
    Barry
    Member

    (… to keep things tidy, I am now closing the thread!)

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘template tags in tabs?’ is closed to new replies.