Problem: How to Return to active tab / set active tab after clicking link` - Forum | JoomShaper
Awaiting an answer SP Page Builder

Problem: How to Return to active tab / set active tab after clicking link`

Asked by John Celano 4 years ago Last activity 4 years ago

I am using the Tabs addon. The problem I have is whenever I return from a link that I've clicked on (with within the content area - in my case it's a text block) I am returned to the 1st tab. Is there no way to return to the active Tab using this addon? I have built an entire site and not being to return to the active will make the user experience disorienting.

Also, is there anyway to set the default active tab?

Joomla 4.1.5
Helix Ultimate
https://card2022.chopcme.com/

5 replies

John Celano Asked this

Wow not one answer here?

Toufiq Senior Staff

Hi there,

Thanks for contacting us. Sorry, right now this feature/functionality is not available. But we will try to considering it for future update. Even we are not sure when that gonna happen.

-Thanks

John Celano Asked this

I'm sorry, this is such basic functionality. It is really dissapointing. I now have to rewrite this whole thing myself as Raw HTML under deadline. Something, I find i have to do with you all to frequently. Ah well, You get what you pay for. So long Joomsahper. It was ok while it lasted.

Toufiq Senior Staff

It was ok while it lasted?

Which version works?

John Celano Asked this
4 years ago · edited

I rewrote the tab function as html (you can see the code on the site). All that is required is a little javascript to achieve the desired behaviour. I am using the browser's local storage object to return to the active tab. This works just like hitting the back button on the browser. Another way to do this is with a data toggle in Bootstrap, which is baked into to Joomla.

$(document).ready(function(){
$('a[data-toggle="tab"]').on('show.bs.tab', function(e) {
localStorage.setItem('activeTab', $(e.target).attr('href'));
});
var activeTab = localStorage.getItem('activeTab');
if(activeTab){
$('#myTab a[href="' + activeTab + '"]').tab('show');
}
});

This doesn't work with your Tabs addon. This only works by writing the HTML for the Tabs.
This is basic, basic functionality and I am stunned that this is not part of your "Tabs" addon. Hope this helps someone else and that you guys will add this or something like it in the future,

Log in to reply.