-
AuthorPosts
-
May 23, 2013 at 4:47 pm #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
May 25, 2013 at 7:01 am #120947Please 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.
May 25, 2013 at 9:03 am #120948I inserted your code but the standard editor windows is still empty and does not show any code.
May 25, 2013 at 11:28 am #120949Hm, 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.
May 25, 2013 at 11:45 am #120950Thanks, 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”.
May 26, 2013 at 6:34 am #120951Ok, 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 = "";
}
}May 26, 2013 at 8:44 am #120952With 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.
May 26, 2013 at 8:53 am #120953Hey!
Yes the { and } brackets were missing. I corrected the code above.
Regards,
Peter
May 26, 2013 at 9:11 am #120954Thanks, now everything is working. Will this bugfix be part of the next update?
May 26, 2013 at 10:54 am #120955Hey!
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
May 26, 2013 at 1:35 pm #120956 -
AuthorPosts
- The topic ‘Possible bug in sorting function of accordion’ is closed to new replies.