WordPress.org

Ready to get started?Download WordPress

Forums

Tabby Responsive Tabs
[resolved] Automattic's Camptix shortcode in a tab (9 posts)

  1. Leah
    Member
    Posted 2 months ago #

    Hi!

    I would like to use a shortcode for camptix (which is a ticketing solution) in a tab (third tab). There are camptix events that will reload the page, and thus the first tab will be displayed which is not the desired one.

    Is there a way to display the tab from where the action originated?

    Thank you

    https://wordpress.org/plugins/tabby-responsive-tabs/

  2. Leah
    Member
    Posted 2 months ago #

    Not much of a coder, but there's a form submit which could perhaps be catched with jquery and then get the right div to display?

  3. cubecolour
    ɹoʇɐɹǝpoɯ
    Plugin Author

    Posted 2 months ago #

    It is not currently possible to specify that an open tab will reopen when the page reloads.

    The next version will have a new shortcode parameter to specify which tab should be open on a page load, however this tab will be open on the initial page load in addition to reloads so this will probably not fit your needs.

    I can make a note of this as a possible feature request, however it is probably not something I can afford to spend time working on unless I had a requirement for this feature in one of my own projects or if someone commissioned the work.

  4. Leah
    Member
    Posted 2 months ago #

    Thanks!

    Looking forward to next version then :)

    In the mean time, while I'm not too good with code, do you think it would be theoretically possible to catch the submit action and add the "responsive-tabs__panel--active" -class to the tablist1-panel3 -div and thus make it display?

  5. cubecolour
    ɹoʇɐɹǝpoɯ
    Plugin Author

    Posted 2 months ago #

    That *might* work if:

    • The submit action writes a cookie.
    • The class is added using jQuery when the page loads only when the cookie is present.
    • The cookie is destroyed to it doesn't trigger on the next load.
  6. Leah
    Member
    Posted 2 months ago #

    Ok!

    I'll see if I can figure something out.

  7. cubecolour
    ɹoʇɐɹǝpoɯ
    Plugin Author

    Posted 2 months ago #

    In addition to the new feature I mentioned above, I have now added an additional feature to my development version of Tabby responsive Tabs which allows a new shortcode attribute of 'target' to be used in the [tabby] shortcode.

    Then, when a page containing at least one tabby tab set loads, if the url has a 'target' url parameter equivalent to one of the tabs on a tab set on a page, that tab will be active when the page loads.

    If the ticketing plugin allows a page to be specified as a confirmation message, the page should be specified with the '?target=tabx' url parameter to force the correct tab to open. I don't know whether it does work like this, but if not maybe there's a hook that enables a filter to be used to modify the returned url by appending the url parameter to the url?

    If you'd like a preview copy of the new version of Tabby Responsive Tabs to try this out and beta test it before it is released, please contact me via the contact form on my site & I'll send you a copy.

  8. Leah
    Member
    Posted 2 months ago #

    Thats great!

    Going to check the camptix plugin right away and maybe pose a question on their support.

    Thanks!

  9. Leah
    Member
    Posted 2 months ago #

    Looking through the Camptix code and for example this line in camptix.php:

    https://github.com/Automattic/camptix/blob/master/camptix.php#L4483

    <form action="<?php echo esc_url( add_query_arg( 'tix_action', 'attendee_info', $this->get_tickets_url() ) ); ?>#tix" method="POST">

    could be altered to:

    <?php $arr_params = array( 'tix_action' => 'attendee_info', 'target' => 'tabx' );?>
    <form action="<?php echo esc_url( add_query_arg( $arr_params, $this->get_tickets_url() ) ); ?>#tix" method="POST">

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.