[4.x] Nested Menus

« [4.x] Where do the avatars come from? :: Changing the date for the title »
Author Message
zadiasstark
Posted: Mon Sep 19, 2011 04:14     Topic subject: [4.x] Nested Menus

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

Back to top
 
tilqicom
Posted: Wed Sep 21, 2011 22:39

by nested, you mean "dropdown" ? if so, check out http://skins.b2evo.net/2/index.php?tempskin=chita

Back to top
 
zadiasstark
Posted: Wed Sep 21, 2011 23:42

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

Back to top
 
tilqicom
Posted: Thu Sep 22, 2011 09:36

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>
Back to top
 
kenton
Posted: Thu Sep 29, 2011 17:16

: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)

Back to top
 
sam2kb
Posted: Fri Sep 30, 2011 02:34

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

Back to top
 
zadiasstark
Posted: Fri Sep 30, 2011 03:20

sam2kb wrote:

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

That would rock!

Back to top
 
sam2kb
Posted: Fri Sep 30, 2011 07:19
Back to top
 
zadiasstark
Posted: Fri Sep 30, 2011 07:33

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?

Back to top
 
sam2kb
Posted: Fri Sep 30, 2011 07:40

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

Back to top
 
sam2kb
Posted: Fri Sep 30, 2011 07:40

Well, I can make a screenshot...

Back to top
 
sam2kb
Posted: Fri Sep 30, 2011 07:47
Back to top
 
kenton
Posted: Fri Sep 30, 2011 11:30

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?

Back to top
 
sam2kb
Posted: Fri Sep 30, 2011 19:20

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

Back to top