• Resolved ntoum

    (@ntoum)


    Hello,

    Is there any way, so i can create a custom tab, and give it my custom id?
    I wanted to make a button that it will open this specific tab.

    If there is not this option, what about adding this to the plugin?

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @ntoum,

    What do you mean by a custom ID? Are you referring to an HTML attribute that you can add to your tab so you can open the tab on the front end?

    Let me know,
    Kevin.

    Thread Starter ntoum

    (@ntoum)

    Hello and thank you very much for your fast response.

    That’s exactly what i meant. The ability, to set a custom html id for the tab in the front end. For example: “size-tab” & “desing-tab”

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Unfortunately our plugin has no control over the front-end presentation of the tabs. We just pass the tab data into WooCommerce’s standard tab generating functionality.

    WooCommerce will assign your tab’s title with a unique ID though. Where were you looking for an ID to be placed? WooCommerce will assign a unique ID to the tab title (specifically the tab title’s <li> element). This will look like tab-title-{tab_slug}. So for a tab named “Saved Tab” the ID of the tab will be tab-title-saved-tab. They will also assign a unique ID to the tab content (specifically the <div> holding the tab content) and that will look like tab-{tab_slug}, for example tab-saved-tab.

    Can you use those IDs?

    Let me know,
    Kevin.

    Thread Starter ntoum

    (@ntoum)

    Hello again,

    Okey, now i understand the reason that seems to be my problem. Of course i can use the IDs above, as you said.

    In my case, i had this #tab-tab-custom-1 html id, and it was increasing only the last number for each custom tab. The problem was caused, by using Greek characters in the tab title. I don’t know if this plugin issue, or of the way that WooCommerce is handle’s the Greek chars.

    I tried to rename them in English, and it seems to be working like the way you said.

    Many thanks for your responses.

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Agh, yes, that makes sense. If we can’t create a tab slug we assign a generic slug of tab-custom-{increment}. For encoding/charset reasons, we can’t create a tab slug using Greek characters (sorry about that!).

    Providing a custom slug field that overrides our slug-creation functionality would be a good solution for this. But it would take a lot of re-writing because the slug is an essential ID for a tab so I wouldn’t expect this any time soon.

    Regardless, glad you’ve found a solution.

    All the best,
    Kevin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Give my custom id in the tab’ is closed to new replies.