Search
Other Tabs & Accordions questions
Forum

Open tab linked to day

Andrew's Avatar Andrew
I'm wondering if it is possible to have the default tab that opens to be linked to the day of the week (i.e. I have tabs Mon, Tue, Wed etc and would be amazing for current day to be default to open) ? Thanks!
Peter van Westen's Avatar Peter van Westen ADMIN
You would have to use php to set the open="true" attribute. You could use Sourcerer inside the tab tags to do this.

Something like:
{tab title="Monday"{source}<?php echo date('l') == 'Monday' ? ' open="true"' : ''; ?>{/source}}
...
{tab title="Tuesday"{source}<?php echo date('l') == 'Tuesday' ? ' open="true"' : ''; ?>{/source}}
...
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription