This seems to be new with Drupal 6.x as I used this in a previous project.
I'm trying to place a custom secondary links menu into the left sidebar of page.tpl.php (or any menu for that matter)
<?php print theme('links', $custom_secondary_links, $attributes = array('class' => 'menulinks')) ?>
with page preprocess $vars declared in my sub-theme's template.php
$vars['custom_secondary_links'] = menu_navigation_links('menu-my-custom-menu',1);
I modified the if $left conditional to include this and it shows, but apparently to arrive at body classes other than no-sidebars, blocks needs to be invoked. (Really?)
<?php if ($left || $custom_secondary_links): ?>
The menu renders, but the body classes remain at an unchanged state. Here, it's 'no-sidebars'
Is there anything I can do to get the sidebar to render placing content in the page.tpl.php ?
Or maybe can I somehow get this to work via blocks (it doesn't as is)?
Thanks.
Comments
Comment #1
brst t commentedFound that answer here :
http://drupal.org/node/86890#comment-1211618
Or in my case, it's a secondary, not a tertiary, so it looks like this : 1 in place of the 2 and with that additional id #sidebar-nav tossed in for good measure :
Substitute your own menu names (hover links at admin/build/menu/list or use devel module) add your version of the above to a php-filtered block and save it to your left or right region. Ding.
Comment #2
brst t commentedChanging the title
Comment #3
brst t commentedNow I want to print this with the parent menu item -- and unlike menu_block, I want that parent item in the menu to be a link.
And since my lengthy searches for how to accomplish this came up with nothing but old Drupal 5 solutions, I thought I'd post my solution.
Using devel module with the 'Execute PHP' block enabled. I loaded up my node and cranked this through that enabled Execute PHP block :
print_r(menu_get_active_trail())Lovely. I see my parent item in ['1']. And now I can extract the building blocks to make my desired parent menu item link :
So into my custom menu block, ahead of the code in the previous post, I add this:
Note the additional class 'mymenuparent'. Now I can style it like a header or, in my case, to match the rest of the menu and share attributes with #sidebar-nav ul.menu and #sidebar-nav li
And my link_path should be listed as its url_alias, so my link code is wrapped up in a neat little url() instead.
print (url($myactive_trail['1']['link_path']));Comment #4
brst t commented