Log in | Register | Lost password

Bottom
Plugin to display categories in a "collapsible" tree-like menu
  • Posted: 12.12.2005, 23:19
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Is there a plugin, or way, that can display categories in a "collapsible" tree like menu? I'm using the great "catbrowser" plugin (which is like the default listbrowser plugin) I found on pagesetter.org but would like to hide sub-categories from view, since I have a lot of them. Thanks for any help.
  • Posted: 04.01.2006, 04:21
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    billguy, that is a great idea, have you found a way to do this? I would love to implement something like that on the Knowledgebase template.

    Let us know what you find.
  • Posted: 04.01.2006, 16:17
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0

    rixride

    have you found a way to do this?


    No, unfortunately. Still interested though. Will post if I find anything. Thanks.
  • Posted: 14.01.2006, 21:00
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    I came up with a quick and dirty fix that sort of accomplishes what I am trying to do. Instead of a collapsible, tree menu, it's a drop down box.

    I'm using the catbrowser plugin b/c I like having the pub. count in my categories. I'm using it like so:

    Code

    <!--[pagesetter_CatBrowser additionalvars="orderby=lastname:asc" field="category" listClass="kb1" showcount="yes" trim="no"]-->


    I modified _CatBrowser.php like so:

    Code

    function pagesetter_CatBrowser_rec(&$items, &$i, $indent, $size, &$url_parameters, &$setup)

    {

    if (isset($setup['listClass']) && $i == 0)

    // $html = "<ul class=\"$setup[listClass]\">\n";

    $html = "<select name=\"catid\" class=\"pn-text\" onchange=\"window.open(this.options[this.selectedIndex].value,'_top')\" ><option value=\"Select\">Select</option>\n";

    else

    $html = "<ul>\n";


    ..then a little further down:

    Code

    $url = pnModUrl('pagesetter', 'user', '', $url_parameters);



    if ($setup['currentValue'] == $item['id'])

    //$html .= "<li><span class=\"current\"><a href=\"$url&orderby=lastname:asc\">$item[title]</a></span>\n";

    $html .= "<option title=\"$item[title]\" value=\"$url&orderby=lastname:asc\">$item[title]</a></option>\n";



    else

    // $html .= "<li$className><a href=\"$url&orderby=lastname:asc\">$item[title]</a>\n";

    $html .= "<option title=\"$item[title]\" value=\"$url&orderby=lastname:asc\">$item[title]</a></option>\n";



    }


    Pretty simple fix. I'd still like to have a way to distinguish sub-categories instead of having one big colossal drop down box. Check out how http://cityweav….com/index.php was done to get an idea of what I mean.

    Later!

Template courtesy of Designs By Darren.