Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » How do I…?
  3. » Tabs

#1 2017-09-11 14:44:48

code365
Member
From: California
Registered: 2009-08-16
Posts: 110
Website

Tabs

I have a page with two tabs (a,b) within the same page with information inside each tab. I was planning to use the body in the article area for tab a, but now I don’t have any way to insert information into tab b. The excerpt is alright used and I don’t want to use the custom tags because the content needs to be formatted.

Thank you for your help TXP community.

Last edited by code365 (2017-09-11 15:22:49)

Offline

#2 2017-09-11 21:16:56

etc
Developer
Registered: 2010-11-11
Posts: 5,087
Website GitHub

Re: Tabs

I hope we’ll have a nice two-body solution with txp 4.8 custom fields… Meanwhile, etc_query might help:

  • split the body of the article into two top-level divs:
    <div>
    first tab content
    </div>
    <div>
    second tab content
    </div>
  • replace <txp:body /> where appropriate with
<txp:etc_query data='<txp:body />' globals="">
<section id="tab1">{div[1]}</section><!-- or any tab markup -->
<section id="tab2">{div[2]}</section>
</txp:etc_query>

Not ideal for long articles, but what can we do?

Offline

#3 2017-09-12 01:45:09

code365
Member
From: California
Registered: 2009-08-16
Posts: 110
Website

Re: Tabs

Thank you etc

Offline

  1. Index
  2. » How do I…?
  3. » Tabs

Board footer

Powered by FluxBB