• Hi,

    Just wondering if there is a recommended way (eg. API) to pre-select a tab on page load.

    I have a membership site with 3 types of members. I want to be able to pre-select a tab based on the membership type.

    I understand that this is custom but was wondering if there was a nice/recommended way to interact with the plugin rather than just hacking with js.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,
    You can right click on the tab and click “copy link address” and use that link to open a page with a preselected tab.

    Is that what you are after?

    Ben

    Thread Starter liquidonthedrums

    (@liquidonthedrums)

    Hi Ben,

    Thanks for your response.

    That’s not quite what I am after. I’m not after an anchor link as I don’t want to browse to that part of the page when it loads, rather just make one tab active dynamically when the page loads.

    Hey,
    The tabs are saved as static HTML (most Gutenberg blocks are), so you can filter that entire block of HTML and render out something different in PHP (this would require a lot of custom coding on your end) or you can use javascript after the page loads to trigger a specific tab to open.

    Otherwise, you can hide/show content based on the user role. For example, making three versions of your tabs, one for each user role and showing the appropriate one per role. That of course though is the hackiest way to do something like this.

    Ben

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Programatically select Tab on load’ is closed to new replies.