• Resolved allexarh

    (@allexarh)


    Hi, I have these 3 tab titles (Title A/Title B/Title C) and each of them has as content a list of webpages (Title A has Page A1/Page A2/Page A3; Title B has Page B1/Page B2/Page B3 and so on). The tab system is present in the same form on all mentioned pages (A1, A2, A3, B1, B2 etc), and functions as a filtering method.

    How can I set as active a specific tab title when a specific page is open? For example, when I am on page B2 I need to have Title B focused.

    Alex

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter allexarh

    (@allexarh)

    So, I reread the documentation on your page, and it seems that what I’m looking for is the “active” shortcode parameter. But I think I am missing something, I can’t get it to work.

    I’m on a page (let’s say) B2 and I set the parameter active="1″ but Title B is not active… What am I doing wrong?

    Thread Starter allexarh

    (@allexarh)

    It seems that no matter what number I enter in the active parameter, in the Inspect Element it remains data-active="0". Can it be something broken in the plugins code?

    Thanks,
    Alex

    Plugin Author Matt Lowe

    (@squelch)

    Hi @allexarh,

    I’m not 100% certain whether I’m understanding what you want to achieve. Looking at the link you shared, I can see a number of pages and, if I’m understanding you correctly, on each of those pages you want a different tab to be open by default. Namely:

    “Concepte” (tab 0)
    https://www.gedeus.ro/portfolio-category/concepte-urban/
    https://www.gedeus.ro/portfolio-category/concepte-parcuri/
    https://www.gedeus.ro/portfolio-category/concepte-locuri-de-joaca/

    “Proiecte” (tab 1)
    https://www.gedeus.ro/portfolio-category/proiecte-gradini-private/
    https://www.gedeus.ro/portfolio-category/proiecte-parcuri-si-spatii-urbane/
    https://www.gedeus.ro/portfolio-category/proiecte-corporate/

    “Executie” (tab 2)
    https://www.gedeus.ro/portfolio-category/executie-gradini-private/
    https://www.gedeus.ro/portfolio-category/executie-urban-executie/
    https://www.gedeus.ro/portfolio-category/executie-amenajari-interioare/

    * I’m listing only the first 3 pages per tab for the sake of simplicity.

    If everything I’ve said so far is correct, then it should just be a case of going through each page in the “Concepte” section and applying the parameter you mentioned, active="0"

    Then for all of the pages in the “Proiecte” section, active="1"

    And for all of the pages in the “Executie” section, active="2"

    I can’t see the shortcodes you’ve used in each page (and I don’t expect you to copy all 17 pages worth of shortcodes) so it’s hard to diagnose your issue, but if you could test this on the first page in the “Proiecte” section and the first page in the “Executie” section then that would be useful.

    Thread Starter allexarh

    (@allexarh)

    You understood perfectly. At this moment every page in the “Proiecte” section has the parameter set to active="1", and every page in the “Executie” section has the parameter set to active="2".

    For example, every page in “Executie” section has this code:

    <span style="font-size: 14pt;">[subtabs title="" disabled="false" collapsible="false" active="2″ event="mouseover"]</span>
    <span style="font-size: 14pt;">[subtab title="Concepte"]</span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/concepte-urban/">Concepte urban</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/concepte-parcuri/">Concepte parcuri</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/concepte-locuri-de-joaca/">Concepte locuri de joaca</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/concepte-horeca/">Concepte horeca</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/concepte-industrial/">Concepte industrial</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/concepte/">Toate conceptele</a></span>
    <span style="font-size: 14pt;">[/subtab]</span>
    
    <span style="font-size: 14pt;">[subtab title="Proiecte"]</span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/proiecte-gradini-private/">Proiecte gradini private</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/proiecte-parcuri-si-spatii-urbane/">Proiecte parcuri ?i spa?ii urbane</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/proiecte-corporate/">Proiecte corporate</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/proiecte/">Toate proiectele</a></span>
    <span style="font-size: 14pt;">[/subtab]</span>
    
    <span style="font-size: 14pt;">[subtab title="Executie"]</span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/executie-gradini-private/">Executie gradini private</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/executie-urban-executie/">Executie urban</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/executie-amenajari-interioare/">Executie amenajari interioare</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/executie-voluntariat/">Executie voluntariat</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/executie-horeca/">Executie horeca</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/executie-corporate/">Executie corporate</a></span>
    <span style="font-size: 14pt;"><a href="https://www.gedeus.ro/portfolio-category/executie/">Toate amenaj?rile</a></span>
    <span style="font-size: 14pt;">[/subtab]</span>
    <span style="font-size: 14pt;">[/subtabs]</span>

    Unfortunately something else must interfere because it’s not working, you may try clicking the pages, and no matter what, Tab 0 (Concepte) remains active. And as i said earlier, even though I set up the active paramater, in the Inspect Element it remains data-active="0".

    I don’t know if this is relevant, but the shortcodes are put in the Portfolio Categories, these are not regular posts or pages.

    Any ideas?

    Plugin Author Matt Lowe

    (@squelch)

    Hi @allexarh,

    First of all I’d suggest cleaning up all the errant

    <span style="font-size: 14pt;">

    and

    </span>

    tags that are wrapping your shortcodes, as they will not be doing you any favours. Extra HTML around your shortcodes can introduce all kinds of issues. However, I doubt they are the cause of the issue you’re seeing.

    I don’t know if this is relevant, but the shortcodes are put in the Portfolio Categories, these are not regular posts or pages

    The fact that they are added to a custom post type shouldn’t affect their functionality.

    I am curious, however, as to why you are using [subtab] and [subtabs]. Have you got a [tab] block wrapping the one you’ve copied+pasted?

    Thread Starter allexarh

    (@allexarh)

    Hi @squelch,

    I cleaned the code and removed all the errant you mentioned. Now, in every page in “Executie” section it looks like this:

    [tabs title="" disabled="false" collapsible="false" active="2″ event="mouseover"]
    [tab title="Concepte"]
    <a href="https://www.gedeus.ro/portfolio-category/concepte-urban/">Concepte urban</a>
    <a href="https://www.gedeus.ro/portfolio-category/concepte-parcuri/">Concepte parcuri</a>
    <a href="https://www.gedeus.ro/portfolio-category/concepte-locuri-de-joaca/">Concepte locuri de joaca</a>
    <a href="https://www.gedeus.ro/portfolio-category/concepte-horeca/">Concepte horeca</a>
    <a href="https://www.gedeus.ro/portfolio-category/concepte-industrial/">Concepte industrial</a>
    <a href="https://www.gedeus.ro/portfolio-category/concepte/">Toate conceptele</a>
    [/tab]
    
    [tab title="Proiecte"]
    <a href="https://www.gedeus.ro/portfolio-category/proiecte-gradini-private/">Proiecte gradini private</a>
    <a href="https://www.gedeus.ro/portfolio-category/proiecte-parcuri-si-spatii-urbane/">Proiecte parcuri ?i spa?ii urbane</a>
    <a href="https://www.gedeus.ro/portfolio-category/proiecte-corporate/">Proiecte corporate</a>
    <a href="https://www.gedeus.ro/portfolio-category/proiecte/">Toate proiectele</a>
    [/tab]
    
    [tab title="Executie"]
    <a href="https://www.gedeus.ro/portfolio-category/executie-gradini-private/">Executie gradini private</a>
    <a href="https://www.gedeus.ro/portfolio-category/executie-urban-executie/">Executie urban</a>
    <a href="https://www.gedeus.ro/portfolio-category/executie-amenajari-interioare/">Executie amenajari interioare</a>
    <a href="https://www.gedeus.ro/portfolio-category/executie-voluntariat/">Executie voluntariat</a>
    <a href="https://www.gedeus.ro/portfolio-category/executie-horeca/">Executie horeca</a>
    <a href="https://www.gedeus.ro/portfolio-category/executie-corporate/">Executie corporate</a>
    <a href="https://www.gedeus.ro/portfolio-category/executie/">Toate amenaj?rile</a>
    [/tab]
    [/tabs]

    I am curious, however, as to why you are using [subtab] and [subtabs]. Have you got a [tab] block wrapping the one you’ve copied+pasted?

    I read on you site that [tab] can sometimes conflict with the theme and I wanted to go with the safer option, hence [subtab]. I don’t have any other thing wrapping the code, it’s all you can see. I modified the code (above) and changed [subtab] & [subtabs] with [tab] and respectively [tabs].

    However, the changes above did not made it work…

    I also tried the following:
    1. deactivated all plugins (except Squelch Tabs plugin, obviously, and Portfolio Post Type plugin – without which the pages wouldn’t appear) – it did not resolved the issue;
    2. removed all the custom CSS and additional JS code I used in the theme – it did not resolved the issue;
    3. activated Twenty Fourteen theme, and tried the shortcode on a different page – it did not resolved the issue.

    It feels like I tried everything I could have think of. Can it be a problem in the plugins code?

    Thanks,
    Alex

    Thread Starter allexarh

    (@allexarh)

    Hi, any thoughts on this? Maybe can you check on your side if it’s working as intended?

    Have a nice weekend!

    Plugin Author Matt Lowe

    (@squelch)

    Hi @allexarh,

    Apologies, www.remarpro.com didn’t notify me of your previous reply…?

    The issue would appear to be:

    active="2″

    You have a straight opening quote " but a fancy closing quote:

    WordPress’s shortcode engine doesn’t like fancy quotes and so ignores the value, it never passes it to Squelch Tabs and Accordions Shortcodes plugin and so it never tells the JavaScript on the page to make that tab active.

    Please replace

    active="2″

    with

    active="2"

    (note the second quote is straight, not slanted) and try again, I believe that should solve your issue.

    • This reply was modified 3 years, 2 months ago by Matt Lowe. Reason: Fix up some formatting
    • This reply was modified 3 years, 2 months ago by Matt Lowe. Reason: Fix gibberish resulting from sleep deprivation
    Thread Starter allexarh

    (@allexarh)

    Wow, such a small detail, I would have never seen that.
    Thanks for helping and explaining this stuff to me, it worked!

    Alex

    Plugin Author Matt Lowe

    (@squelch)

    No problem, glad you got it sorted.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘set autofocus on specific tab’ is closed to new replies.