Linking to a specific tab from a button link

Hi there.

I would like to know if you and your team can help me with an issue, please, with the site: http://ibtemplate.webflow.io:

  1. On the jobs page, for exemple: http://ibtemplate.webflow.io/jobs/usability-and-interaction-designer, we have “Jobs” button.

  1. Clicking on the button I would like to link to a specific tab on IB | Smart? Crazy? Ambitious?. So, I would like to have active the “Jobs” tab to show all the jobs.

It´s going now to:

But I would like to go to this way and I don´t use as default the “Jobs” tab.

Kind regards.

  1. Create individual classes for all your tabs

  2. Put the code below into Site Settings > Custom Code > Footer Code:

     <script>
     function getParam(name) {
         name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
         var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
         results = regex.exec(location.search);
         return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
     }
     var Webflow = Webflow || [];
     Webflow.push(function () {
         var tabName = getParam('tab');
         if (tabName) $('.' + tabName).triggerHandler('click');
     });
     </script>
    
  3. Append this to the href/URL on the button you are linking from

     /pagename?tab=tabclass
    

    Replace pagename and tabclass with slug of the page that the tabs are in. eg. If the tabs are in the ‘about’ page and you want to link to the 2rd tab with a class of ‘secondtab’, then;

     /about?tab=secondtab
    

Hope this helps. This topic was discussed here;

6 Likes

Thank you so much @AlexManyeki!
Perfect!

1 Like

This topic was automatically closed after 60 days. New replies are no longer allowed.