Log in | Register | Lost password

Goto page: [-1] 1 - 2

Bottom
CatBrowser of cityweaver.com
  • Posted: 21.09.2007, 17:44
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Do you have a link so I can see it in action...

  • Posted: 21.09.2007, 18:04
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    No sorry, I haven't tryed it but another one few days ago and I've kicked it.
    Sorry...

    There is another solution :
    http://elfisk.dk/index.php?module=pnForum&func=viewtopic&topic=1751&highlight=tableBrowser

    But it doesn't display item in the good order.
    They are displayed like that :
    Cat A | Sub-cat A1 | Sub-cat A2
    Sub-cat A3

    and not :
    Cat A Cat B
    Sub-cat A1 Sub-cat B1
    Sub-cat A2 Sub-cat B2
    Sub-cat A3 Sub-cat B3

    Have you tryed it ?
  • Posted: 21.09.2007, 23:14
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    There are some good ideas in here:
    http://www.alistapart.com/articles/multicolumnlists

    If you combine one of these methods with a javascript to make the tree view you could have what you want.

    Would make a great plugin though, where a person could choose the number of columns, choose the css file to use(making them skinable), and set options in the JS right from the template.

    Take care,
    Mike
  • Posted: 22.09.2007, 01:53
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Ok, I took a look at it and came up with something...

    Now I'll say that this was a 5-min hack and since I have no use for the catBrowser plugin (my site doesn't use it) I won't be investing too much time in it just yet...

    Here's the link to a dummy site I have. The category is called "cat" and the options are listed below. I created one publication for each category option...

    http://vitaminwaterracing.binaryoven.com/index.php?module=Pagesetter&tid=6

    So whatever your top-level category is called will appear at the top in dark blue where I have "cat"

    I haven't tried it with multiple nested categories but I don't think it would be that hard.

    Here's the part of the CatBrowser plugin I modified (Just replace the last function: function "pagesetter_CatBrowser_rec"):

    Code

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

    {

    $topcount = smarty_function_pagesetter_CountPubs(array('tid' => $setup['tid'], 'filter' => $filter), &$smarty);

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

    $html = "<div id=\"$setup[listClass]\">

    <ul>

    <li><a href=\"#\">$setup[field] ($topcount)</a>

    <ul>\n";

    else

    $html = "<ul>\n";





    while ($i < $size)

    {

    $item = $items[$i];

    if ($item['indent'] < $indent)

    break;

    pnModAPILoad('pagesetter', 'admin');

    pnModAPILoad('pagesetter', 'user' );

    $url_parameters['filter'] = "$setup[field]^sub^$item[id]";

    $url_parameters['cv'] = $item['id'] ;

    $thisfilter = "$setup[field]:sub:$item[id]";

    $filter = smarty_function_pagesetter_createFilter (array('filter' => $thisfilter), &$smarty);

    $thiscount = smarty_function_pagesetter_CountPubs(array('tid' => $setup['tid'], 'filter' => $filter), &$smarty);

    if($thiscount > 0 || $setup['trim'] == "no")

    {

    if ($setup['showcount'] != "no")

    {

    if ($thiscount == 1)

    {

    $numstr = str_replace("%%NOM%%", $thiscount, $setup[oneform]);

    $item[title] = $item[title] . $numstr;

    }

    elseif (thiscount == 0)

    {

    $numstr = str_replace("%%NOM%%", $thiscount, $setup[noneform]);

    $item[title] = $item[title] . $numstr;

    }

    else

    {

    $numstr = str_replace("%%NOM%%", $thiscount, $setup[numform]);

    $item[title] = $item[title] . $numstr;

    }

    }

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



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

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

    else

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

    }



    ++$i;



    if ($items[$i]['indent'] > $indent)

    {

    $html .= pagesetter_CatBrowser_rec($items, $i, $indent+1, $size, $url_parameters, $setup);

    }



    $html .= "</li>\n";

    }



    $html .= "</ul>

    </li>

    </ul>

    </div>\n";



    return $html;

    }


    And here's the CSS I used:

    Code

    navcontainer ul

    {

    margin: 0;

    padding: 0;

    list-style-type: none;

    }



    navcontainer a

    {

    display: block;

    color: #FFF;

    background-color: #036;

    width: 9em;

    padding: 3px 12px 3px 8px;

    text-decoration: none;

    border-bottom: 1px solid #fff;

    font-weight: bold;

    }



    navcontainer a:hover

    {

    background-color: #369;

    color: #FFF;

    }



    navcontainer li li a

    {

    display: block;

    color: #FFF;

    background-color: #69C;

    width: 9em;

    padding: 3px 3px 3px 17px;

    text-decoration: none;

    border-bottom: 1px solid #fff;

    font-weight: normal;

    }




    edited by: RemShowdown, Sep 22, 2007 - 04:15 PM
  • Posted: 24.09.2007, 08:57
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    I haven't got any time to try it right now but I will do it soon.

    Thanks ;)

    EDIT : I came to try it but it doesn't change many things. Do you think that can do the same thing but with choosing the number of column can be displayed ?

    It would be so usefull :-D



    edited by: Starguezer, Sep 24, 2007 - 10:45 AM
  • Posted: 24.09.2007, 17:18
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Let me clarify:

    The method I posted needs to be called for EACH category. This allows the inclusion or exclusion of any category you have. You can also place each list wherever you like.

    In this case I have 3 lists in 3 columns in a table:

    Code

    <table width="100%" border="0" cellspacing="0" cellpadding="0">

    <tr>

    <td><!--[pagesetter_CatBrowser field="CATEGORY1" listClass="navcontainer" showcount="yes" trim="yes"]--> </td>

    <td><!--[pagesetter_CatBrowser field="CATEGORY2" listClass="navcontainer" showcount="yes" trim="yes"]--></td>

    <td><!--[pagesetter_CatBrowser field="CATEGORY3" listClass="navcontainer" showcount="yes" trim="yes"]--></td>

    </tr>

    </table>

Goto page: [-1] 1 - 2

Template courtesy of Designs By Darren.