How To Make Page Open On Specific Tab

Ceri
Ceri
@adolygwr
7 years ago
370 posts
How can I construct a link to an individual tab on this page:- https://americymru.net/st-davids-day

Basically I want to provide a link directly to the Book Sale tab. I tried:- https://americymru.net/st-davids-day#booksaletab but that doesn't work.

I want to link directly to this tab from the Shop Now button on Facebook. Is it possible?




--
Ceri Shaw - AmeriCymru

updated by @adolygwr: 06/03/17 09:37:18AM
michael
@michael
7 years ago
7,715 posts
Its not impossible, but its also not currently simple.

Those tabs are javascript locations, so they only show when javascript is run.

this javascript:
jrSiteBuilder_load_tab('37', '1', '535') // AmeriCymraeg
jrSiteBuilder_load_tab('37', '1', '528') // Recipies
So if there was something in one of your templates, say header.tpl, or in a "Template Code" widget on the page that had a way to pick up something from the URL and fire the appropriate code to open the tab, then that would make it possible.

Pretty sure there is no code currently in place to do it as is.

Guessing what you're after is something like:
https://americymru.net/st-davids-day#book-sale
https://americymru.net/st-davids-day#recipies
.....
Ceri
Ceri
@adolygwr
7 years ago
370 posts
Yes thats what I want..... so if I add the js in a template code block at the top of each tab widget what would the link look like to take viewers to individual tabs?

Does / / booksaletab in js translate into https://americymru.net/st-davids-day#booksaletab as an url?


--
Ceri Shaw - AmeriCymru
michael
@michael
7 years ago
7,715 posts
I'll see If I can get something worked into Site Builder.
michael
@michael
7 years ago
7,715 posts
Think I've found a way that will work. Will get the team to test it out, then if its ok release it.
Ceri
Ceri
@adolygwr
7 years ago
370 posts
Great.....many thanks!!!! :)


--
Ceri Shaw - AmeriCymru
michael
@michael
7 years ago
7,715 posts
We've got a solution in place for this in the next version. We're gearing up for the next big increment release of core to 6.1 so will hold off on releasing the Site Builder module until that comes out so that i can be certain its going to work as expected.

The way it will function is when you click a tab it will add the full url to that tab to the address bar:
yoursite.com
click on tab4 and the url will change to
yoursite.com#tab4

Then if you visit the site with that URL the tab will be selected.