By default the first tab in a tab set will be the open tab.
You can also set any other tab to be the default open tab instead by adding the open
attribute to that tab's tag and give it the value true
, like:
{tab title="This tab is now opened by default!" open="true"}
First tab
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
This tab is now opened by default!
Aenean commodo ligula eget dolor. Aenean massa.
Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Another tab
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
Nulla consequat massa quis enim.
Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.
Syntax
Indentation in example code is just for clarity. You should not indent your tags and text.
{tab title="First tab"}
[TEXT]
{tab title="This tab is now opened by default!" class="green" open="true"}
[TEXT]
{tab title="Another tab"}
[TEXT]
{/tabs}
With the Pro version, you also have the ability to make a different tab open randomly every time the page is refreshed. This would allow to present different content when the page is revisited.
You can do so by placing an open="random"
parameter to the first tab in the set, like:
{tab title="First Tab" open="random"}
...
{tab title="Second Tab"}
...
{/tabs}
First Tab
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Second Tab
Aenean commodo ligula eget dolor. Aenean massa.
Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Third Tab
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
Nulla consequat massa quis enim.
Fourth Tab
Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.
Syntax
Indentation in example code is just for clarity. You should not indent your tags and text.
{tab title="First Tab" open="random"}
[TEXT]
{tab title="Second Tab"}
[TEXT]
{tab title="Third Tab"}
[TEXT]
{tab title="Fourth Tab"}
[TEXT]
{/tabs}
Try refreshing this page and see the opened tab in this set being random every time.