- πΊπ¦Ukraine AstonVictor
I'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks
I think it's the most common use-case: integrate nice_menus with the top main-menu of an existing theme.
So, let's say we use a child theme of Bartik containing the bare minimum (only intended to override some properties).
The default Bartik page.tpl.php contains the following:
<?php if ($main_menu): ?>
<div id="main-menu" class="navigation">
<?php print theme('links__system_main_menu', array(
'links' => $main_menu,
'attributes' => array(
'id' => 'main-menu-links',
'class' => array('links', 'clearfix'),
),
'heading' => array(
'text' => t('Main menu'),
'level' => 'h2',
'class' => array('element-invisible'),
),
)); ?>
where $main_menu
comes from includes/theme.inc
/ template_preprocess_page()
when it calls menu_main_menu()
.
menu_main_menu()
will call menu_navigation_links("main-menu")
which only returns the 1st level entries (whatever second argument is passed...)Let's forget the above note about performance for now,
hook__preprocess_page(&$variables)
setting $variables['main_menu']
may be a good candidate for this but... which function to use to retrieve a deeper but similar structure than what menu_main_menu()
returns ? menu_tree()
?<ul>
(id and classes) and override <li>
(classes), thus using the themable links__system_main_menu
But here seem to come big troubles of menu_tree()
to replace menu_main_menu()
, at least because rendering recursively the menu without control on the top level <ul>
makes all of them getting the what is obviously wrong.
So, let's believe that menu_tree()
is the good candidate, how to theme it ?
The problem is obviously that the structure it returns contains #theme_wrappers
== menu_tree__main_menu
whatever the <ul>
depth is.
Can we try to change it so that the first level #theme_wrappers
is a themable we can control ?
follow-up coming.
Closed: outdated
2.0
Documentation
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks