Recent Topics

[4.x] Nested Menus

Thread started by , Mon Sep 19, 2011 04:14 – Last touched: Mon Sep 19, 2011 04:14
Started by , 09/19/11

Sep 19, 2011 04:14    

My b2evolution Version: 4.x

Is it possible to create nested menus for the top bar?
If so, guidance would be appreciated

http://www.revenantsoflordaeron.com/

Thanks
Zad

Comment from:

Thanks,
That is what I'm looking for. But now, how to do it :D
Not seeing any documentation.

09/21/11 @ 23:42

Comment from:

ZadiasStark wrote:

Thanks,
That is what I'm looking for. But now, how to do it :D
Not seeing any documentation.

there is no documentation :P

a function called 'display_list_cats' (thanks to sam2kb) brings the page+category list.The function is as follows:

The rest is just css.

PHP

function display_list_cats$option_all '' )
    {
        global $Plugins;
        
        ob_start();
        skin_widgetarray(
            // CODE for the widget:
            'widget' => 'coll_category_list',
            // Optional display params
            'block_start'            => '',
            'block_end'                => '',
            'block_title_start'        => '',
            'block_title_end'        => '',
            'block_display_title'    => false,
            'list_start'            => '',
            'list_end'                => '',
            'item_start'            => '<li class="cat-item">',
            'option_all'            => $option_all// T_('All')
        ) );
        
        $widget_cat ob_get_clean();
        
        if( $widget_cat_fixed = @preg_replace'~<a(.*?)href="(.*?)">(.*?)</a>~',
                    '<a class="fadeThis" $1href="$2"><span class="entry">$3</span></a><a href="$2?tempskin=_rss2" class="rss_feed"></a>',
                    $widget_cat ) )
        {
            echo $widget_cat_fixed;
        }
        else
        {
            echo $widget_cat;
        }
    }

insert the above code in your _skin.class.php file in your skin folder, and the below code where you want to display the menu -list-.

Code

<div id="catnav"><ul id="categories_nav"><?php display_list_cats(); ?></ul></div>
09/22/11 @ 09:36

Comment from:

:idea: Neat solution to a problem that has been puzzling me since starting with b2evo.

"tilqicom" wrote:

ZadiasStark wrote:

Thanks,
The rest is just css.

Which is easier said than done and it doesn't seem to display well without it.

I wish there was some documentation on the categories, how the widget works and how to modify it.
There are a number of other ways of presenting the list that could improve things. Also options such as list only used categories (ie postcount > 0)

09/29/11 @ 17:16

Comment from:

I have a plugin that creates nested menus. Let me see if I can find it...

09/30/11 @ 02:34

Comment from:

sam2kb wrote:

I have a plugin that creates nested menus. Let me see if I can find it...

That would rock!

09/30/11 @ 03:20

Comment from:

Thanks alot :D

Do you have a site where its in use, so I can see if it meets what I want to do, before I install it?

09/30/11 @ 07:33

Comment from:

No, it's only on my laptop.
Try it, it won't kill your server ;)

09/30/11 @ 07:40

Comment from:

Ah a solution to dropdown menu of blogs

but not quite the same as tilqicom's solution (w/o css) for dropdown menu of categories?

09/30/11 @ 11:30

Comment from:

It does display dropdown of categories, just edit it a bit and delete the parent blog level leaving only categories list.

09/30/11 @ 19:20
powered by b2evolution – This forum is powered by b2evolution CMS, a complete engine for your website.