Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Selectable panel items

AaronWebsteyAaronWebstey Headband AfficionadoCole Harbour, NS ✭✭✭

It would be nice to be able to select which panel items to collapse. I may try to implement this. E.g. I'd like to leave categories and latest posts expanded by default, but collapse the rest :)

Comments

  • peregrineperegrine MVP
    edited December 2014

    to do what you want.

    just identify the id or class.

    Personally I like the idea of plugins panel modules to add a class to the Box Class
    instead of adding a id like LatestPostList does since for some bizarre reason someone may want to add two modules.

    class="Box YourAdditonalBox">';

    just change the js in plugin.

    from

        // Collapse all the panels by default
        $('.PanelBoxToggle').children('h4 ~ *').hide();
    

    use a not for every module you don't want collapsed at inception.

    // Collapse all the panels by default
        $('.PanelBoxToggle').not('.BoxCategories').not('#LatestPostList').children('h4 ~ *').hide();
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Thanks yet again @peregrine‌ !

  • peregrineperegrine MVP
    edited December 2014

    @AaronWebstey said:
    Thanks yet again peregrine‌ !

    you are welcome.

    otherwise known as thanks, YAP! :wink:

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited December 2014

    see below.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited December 2014

    or you could do it via config.php

    change the js in PanelBoxToggles

        jQuery(document).ready(function($){
        // add this line
        var $excludeboxes = gdn.definition('ExcludeBox');
    
    
    change  this line
    
    
        $('.PanelBoxToggle').children('h4 ~ *').hide();
        to
        $('.PanelBoxToggle').not($excludeboxes).children('h4 ~ *').hide();
    

    change in class.panelboxtoggles.plugin.php

    from

    $Sender->AddCSSFile($this->GetResource('design/panelboxtoggles.css', FALSE, FALSE));

    to

                          $Sender->AddCSSFile($this->GetResource('design/panelboxtoggles.css', FALSE, FALSE));
                           $ExcludeBoxes = C("Plugins.PanelBoxes.ExcludeBoxes",".DummyBox" );
                            $Sender->AddDefinition('ExcludeBox', $ExcludeBoxes);
    

    then add to config.php

    $Configuration['Plugins']['PanelBoxes']['ExcludeBoxes'] = ".BoxCategories, #LatestPostList";

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • one more fix to get the arrow aligned correctly whether boxes are initially collapsed or open

    // Collapse all the panels by default
    
        $('.PanelBoxToggle').not($excludeboxes).children('h4 ~ *').hide();
        $('.PanelBoxToggle').addClass('Collapsed');
            $($excludeboxes).removeClass('Collapsed');
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.