[Solved] There are two mistakes, one small, the second is more...

2»

Comments

  • The issue isnt x00's addon but a glitch between std vanilla and his mod, but i think this fix would best be added to his plugin css. We had similar issue, that being entire li becomes click issue as opposed to the a link.

    Discovered it wasnt his addon at fault.

    There was an error rendering this rich post.

  • 422 said:
    The issue isnt x00's addon but a glitch between std vanilla and his mod, but i think this fix would best be added to his plugin css. We had similar issue, that being entire li becomes click issue as opposed to the a link.

    Discovered it wasnt his addon at fault.

    It is possible that the problem is not in the expansion. But I still think that it is in it. Checked in the default template, the problem repeats itself as in the template iVanilla.

    screens of both templates.

    The category "Computers" is pressed, but under categories didn't reveal. Should be so, time I am interested in the category "Computers" and pressed it, under categories should reveal, in order that I too knew about them.

    And under categories reveal only after pressing the arrow image.

    Default template

    iVanilla template

  • Not sure, but i am guessing minify is the issue. My advice, ditch the minify plugin. You may need to delete all .ini files in cache folder too.

    Not knowing where you added the css fix, ensure it is present in all custom.css theme files.

    There was an error rendering this rich post.

  • 422 said:
    Not sure, but i am guessing minify is the issue. My advice, ditch the minify plugin. You may need to delete all .ini files in cache folder too.

    Cache cleaned

    Not knowing where you added the css fix, ensure it is present in all custom.css theme files.

    In all css added. It did not work, it remains as before.

  • Have you got link to forum that has the issue?

    There was an error rendering this rich post.

  • could be a javascript conflict.

    grep is your friend.

  • 422 said:
    Have you got link to forum that has the issue?

    link to the website - http://vamchavo.ru

  • If I goto one of your forums, you have js error as @x00 pointed out. In fact its a js syntax issue, I couldnt tell you what it is as its all double dutch to me... or possibly russian ;)

    There was an error rendering this rich post.

  • It think I understand what you mean, but the default behaviour is not to expand when the page loads.

    if you want that put

     jQuery(document).ready(function($){
          $('ul.PanelCategories li.Active').trigger('mouseup');
     });
    

    in your theme's js/custom.js

    I might put a configuration option in the next release, to make this simple.

    if you expect a persistence of where you a have been that isn't really what I'm aiming for with this plugin.

    grep is your friend.

  • x00 said:
    It think I understand what you mean, but the default behaviour is not to expand when the page loads.

    if you want that put

     jQuery(document).ready(function($){
          $('ul.PanelCategories li.Active').trigger('mouseup');
     });
    

    in your theme's js/custom.js

    I might put a configuration option in the next release, to make this simple.

    if you expect a persistence of where you a have been that isn't really what I'm aiming for with this plugin.

    Thanks, I will wait for updating of your plug-in with this parameter.


    Спасибо, буду ждать обновления вашего плагина с этим параметром.

  • http://vanillaforums.org/addon/categoryaccordion-plugin

    set

    $Configuration['Plugins']['CategoryAccordion']['ExpandActiveOnLoad'] = TRUE;

    in conf/config.php

    grep is your friend.

  • Many thanks for the help

  • edited August 2012

    @x00

    When clicking a child category below a parent the active parent still closes (it stays open only if you click on the parent with your fix). Here's my method of fixing that:

    jQuery(document).ready(function($){
        $('ul.PanelCategories li.Depth1, ul.PanelCategories li.Heading').each(function(){
          //new code start (1of2) - mark Parent that contains a Child that has the class=Active or itself is Active
          if( $(this).nextUntil('li.Depth1,li.Heading','li:not(.Depth1)').is('li.Active') || $(this).is('li.Active') ) {
            $(this).addClass('ActiveParent');
            }
          //new code end
            if($(this).next().is('li.Depth2')){
             //find li.Depth1 or li.Heading where next li is Depth2 and give it class=CatAccordionHead (used by css to give rightarrow)
                $(this).addClass('CatAccordionHead');
             //for the following subcategories create a new ul with class=CatAccordion (used by css)
                $(this).nextUntil('li.Depth1,li.Heading','li:not(.Depth1)').wrapAll('< ul class="CatAccordion"> < li class="CatAccordion">');
            }
          else{
             //if not a li.Heading or li.Depth1 with follow on li.Depth2's then add in the following hidden 
             //without this the parent category disappears when the children are exposed
                $(this).after('< ul class="CatAccordionNone"> < li class="CatAccordion">');
              }
        });
        $('ul.PanelCategories').accordion({
            'header':'li.Depth1,li.Heading',
            'active':false,
            'collapsible':true,
            'autoHeight': false,
            'event':'mouseup'
        });
        
        if(gdn.definition('ExpandActiveOnLoad')==1)
    //    $('ul.PanelCategories li.Active').trigger('mouseup');
          //new code start (2of2)
            $('ul.PanelCategories li.ActiveParent').trigger('mouseup');
          //new code end
        
        
    });
    

    Small tweak to what you did. Basically I added code that marked the ActiveParent, then triggered a mouseup on li.ActiveParent instead of li.Active.

    On a different note, I would like to generate categories via a perl script (or any command line means). Have you by any chance done anything like that? The tricky part looks like rebuilding the left and right tree ids in mysql. I'll generate a new question for that since it is off topic here.

Sign In or Register to comment.