Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #23733

    I just tested the accordion with activated sorting function to create a glossary. I added 4 toggles, each with only one Tag (A, B, C, D). But in the frontend the sorting is messed up. Instead of All / A / B / C / D with All default, it shows A / All / B / C / D with A default, see the following picture: http://imghost4you.com/images/accordion.jpg

    #120947

    Please add following code to functions..php:

    //set builder mode to debug
    add_action('avia_builder_mode', "builder_set_debug");
    function builder_set_debug()
    {
    return "debug";
    }

    Then switch to the “standard” editor and post the code of the advanced editor (which should be visible in the standard editor now) in this forum. It helps me to reproduce the bug.

    #120948

    I inserted your code but the standard editor windows is still empty and does not show any code.

    #120949

    Hm, I tested it now and my instructions are wrong. You need to add the code to functions,php and you MUST insert it at the very top – insert it before:

    global $avia_config;

    2) You don’t need to switch to to the standard editor but the debug field will be displayed underneath the editor. Copy this code and post here please.

    #120950

    Thanks, here is the code:

    [av_toggle_container initial='0' mode='accordion' sort='true']

    [av_toggle title='Toggle A' tags='A']

    Toggle Content goes here

    [/av_toggle]

    [av_toggle title='Toggle B' tags='B']

    Toggle Content goes here

    [/av_toggle]

    [av_toggle title='Toogle C' tags='C']

    Toggle Content goes here

    [/av_toggle]

    [av_toggle title='Toggle D' tags='D']

    Toggle Content goes here

    [/av_toggle]

    [/av_toggle_container]

    I found out that if the tag is above “Alle” in the alphabet, than the Tag will be shown before and is the default value, for example “A” or “Ak” will be shown before, “Am” after “Alle”.

    #120951

    Ok, in wp-contentthemesenfoldconfig-templatebuilderavia-shortcodestoggles.php replace:

    if(!empty(avia_sc_toggle::$tags))
    {
    avia_sc_toggle::$tags[__('All','avia_framework' )] = true;
    ksort(avia_sc_toggle::$tags);

    foreach(avia_sc_toggle::$tags as $key => $value)
    {
    $output .= "<a href='#' data-tag='{{$key}}' class='{$first}'>{$key}</a>";
    $output .= "<span class='tag-seperator'>/</span>";
    $first = "";
    }
    }

    with:

    if(!empty(avia_sc_toggle::$tags))
    {
    ksort(avia_sc_toggle::$tags);

    $output .= "<a href='#' data-tag='{".__('All','avia_framework' )."}' class='{$first}'>".__('All','avia_framework' )."</a>";
    $output .= "<span class='tag-seperator'>/</span>";

    foreach(avia_sc_toggle::$tags as $key => $value)
    {
    $output .= "<a href='#' data-tag='{{$key}}' class=''>{$key}</a>";
    $output .= "<span class='tag-seperator'>/</span>";
    $first = "";
    }
    }

    #120952

    With your code the order is now right, but it produces a new problem: When i select a filter and then switch back to “Alle”, no accordion toggles will be displayed.

    #120953

    Hey!

    Yes the { and } brackets were missing. I corrected the code above.

    Regards,

    Peter

    #120954

    Thanks, now everything is working. Will this bugfix be part of the next update?

    #120955

    Hey!

    Yes, tbh I guess it makes more sense to display the “all” sort filter at the very beginning. I’ll tag this thread for Kriesi.

    Regards,

    Peter

    #120956

    Hey!

    Thanks, will be added ;)

    Best regards,

    Kriesi

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Possible bug in sorting function of accordion’ is closed to new replies.