Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1469354

    I tried to use accordion in an admin notice, so user would get information on what to do, but wouldn’t have to see ALL information in one big gulp.
    This was a “tester” to see if would work in admin. It didn’t. It just put the four lines at the point in the page where I’d hoped for an accordion.

    I just see…but they’re just text, not clickable accordion items.

    Toggle 1

    Toggle Content for first tab goes here

    Toggle 2

    Toggle Content for second tab goes here

    Here is my code —
    As you can see in my comments to code, I realize I need to add that accordion code.
    Might I be able to use the avf_shortcode_no_header_request? If so, how?

    //In order for this to work, I will need to somehow load the code for accordion.
    //Apparently this means, either load ALL elements when don’t need all…OR
    //perhaps something with https://github.com/KriesiMedia/enfold-library/blob/master/actions%20and%20filters/Request%20Handling/avf_shortcode_no_header_request.php
    //and avf_shortcode_no_header_request.php

    function sample_admin_notice__success() {

    echo ‘<div class=”somethinghere”>’;
    echo do_shortcode(“[av_toggle_container initial='0' mode='accordion' sort='' custom_class='' av_uid='av-w8wcwc']
    [av_toggle title='Toggle 1' tags='' av_uid='av-37adsc']
    Toggle Content for first tab goes here
    [/av_toggle]
    [av_toggle title='Toggle 2' tags='' av_uid='av-vu501g']
    Toggle Content for second tab goes here
    [/av_toggle]
    [/av_toggle_container]“);
    echo ‘</div>’;
    }
    add_action( ‘admin_notices’, ‘sample_admin_notice__success’ );

    Can this be done with avf_shortcode_no_header_request or another method?

    #1469360

    Hey CharlieTh,

    Thank you for the inquiry.

    This will not work because the accordion or toggle relies on resources that are only loaded on the frontend or within the builder. Unfortunately, loading the scripts and css manually can be a bit complicated since they depend on each other. You may need to load all the theme scripts just to make this small tab function properly.

    Best regards,
    Ismael

    #1469363

    Appreciate the speedy reply. Sigh. Enfold magically does ALMOST everything. I am super happy with that almost. I will do this one little tiny thingie differently.
    Thanks again for the speed, so I can look at different options.
    Will see how much is the “cost” of loading EVERY element, but think probably not worth it.

    #1469374

    Hi,

    Thanks for the update. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.