Tagged: toggle
-
AuthorPosts
-
January 15, 2020 at 10:40 pm #1174698
Hello there,
I have a toggle to show a large table and I’d like to have a second toggle button (the +/-) at the end of the toggle when it’s open, because else I have to scroll way up to close the toggle via the button. Is that achievable in a simple manner? Or could you lead me there a few steps? Thank you.January 16, 2020 at 4:08 pm #1175071Just an additional thought: If the button could ‘come down’ after some scrolling and then be clickable at the bottom. After click to close it would switch back into position.
January 17, 2020 at 12:57 pm #1175352Hi,
Thank you for the update.
Where can we see the toggles? Please post the URL of the page.
If you want to duplicate the toggles, edit the enfold\config-templatebuilder\avia-shortcodes\toggles\toggles.php file and look for this code around line 864:
$output .= ' <span class="vert_icon"></span><span class="hor_icon"></span></span>';
That is the toggle buttons. You can insert it again after the content, and only display it when the toggle is active.
$output .= '<div class="toggle_content invers-color '.$inherit.'" '.$markup_text.' '.$colors.' >'; $output .= ShortcodeHelper::avia_apply_autop( ShortcodeHelper::avia_remove_autop( $content ) ); $output .= '</div>';
Best regards,
IsmaelJanuary 20, 2020 at 6:22 pm #1176379Hi Ismael, it’s not that easy. I’m using a workaround now which I’d like to share with you:
$output .= '<section id="'.$toggle_atts['custom_id'].'" class="av_toggle_section" '.$markup_tab.' >'; $output .= ' <div role="tablist" class="single_toggle" '.$this->create_tag_string($toggle_atts['tags'], $toggle_atts).' >'; $output .= ' <p data-fake-id="#'.$toggle_atts['custom_id'].'" class="toggler '.$titleClass.$inherit.'" '.$markup_title.' '.$colors.' '.$hover_styling_markup.' role="tab" tabindex="0" aria-controls="' . $toggle_atts['custom_id'] . '-container">'.$toggle_atts['title'].'<span class="toggle_icon" '.$icon_color.'>'; [...] $output .= ShortcodeHelper::avia_apply_autop( ShortcodeHelper::avia_remove_autop( $content ) ); $output .= ' <a href="#'. $toggle_atts['custom_id'] . '">back to top</a>'; $output .= ' </div>'; $output .= ' </div>'; $output .= ' </div>'; $output .= '</section>';
but what’s not working is to use toggles.php in a child theme’s folder (rebuilding the structure config-templatebuilder\avia-shortcodes\toggles)
January 21, 2020 at 4:39 pm #1176819Hi,
Thank you for following up.
You should be able to create a new shortcode path in the child theme directory using the following filter. This will allow you to override existing shortcodes and create custom ones. Please check the documentation below for more info.
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
Best regards,
IsmaelJanuary 22, 2020 at 5:33 pm #1177232Thank you for that valuable hint. When you click on the anchor link some click handler seems to intermit so you have a short flickering, though. But the solution is good enough, can be closed.
January 23, 2020 at 8:01 am #1177416Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Second toggle button at end of toggle’ is closed to new replies.