I'm working with some graphic designers who are still coming up to speed on Drupal. We're trying to create a horizontal menu with data from a taxonomy. It's three deep. Ideally the first level would be horizontal, the second and third would be vertical, ie, the menu options drop down, and then if there is a third level it comes out and drops down again.
After looking at a number of options (eg. jsdoMenu, rewriting our xTemplate them in phpTemplate, hardcoding menu, etc) we decided we would try to get Nick Lewis' phpTemplate menu (http://www.dynamicdrive.com/dynamicindex1/hvmenu/index.htm) working in xTemplate. Not sure this is feasible... Anyway, we've got the css stuff working but want to find a hack that would allow us to run a php snippet in the appropriate place in the template.
Under the existing <tr> for the logo and primary and secondary menus we were thinking of doing something like: <tr><td colspan="2" class="topmenu">test<?php
$TheMenu = theme_menu_tree(17);
print $TheMenu;
?> </td></tr>
Can we create a {mymenu} that would run this code snippet?
Or is there a different way we can do this using xTemplate?
Advice welcome. (Yeah, we should have figured out menuing before doing theme in xTemplate, but we're newbies...)
Cheers,
Joe Murray, PhD President, JMA Consulting 57 Grandview Ave, Toronto, Ontario, Canada M4K 1J1 416.466.1281, 416.466.1277 (f) joe.murray@jmaconsulting.biz Skype: josephpmurray
In 4.7 this is all handled in core. It has been quite well documented in the code so I suggest you read the example code in the core themes in HEAD and the functions in menu.module
Pre 4.6 I developed a module called primary_links to handle this. But as the name "module" indicates it is quit "bolted on". You can use it well, but I suggest you best not use it when you distribute the sites for people that will have to built there own menus afterwards. For your own development it should work without any problems.
both the 4.7 and primary links solutions are a lot better controllable by themes. And both use the menu UI to define the links. In combination with taxonomy_menu.module you will not even have to hand-manage the menus!
Ber
Op woensdag 04 januari 2006 00:12, schreef Joe Murray:
I'm working with some graphic designers who are still coming up to speed on Drupal. We're trying to create a horizontal menu with data from a taxonomy. It's three deep. Ideally the first level would be horizontal, the second and third would be vertical, ie, the menu options drop down, and then if there is a third level it comes out and drops down again.
After looking at a number of options (eg. jsdoMenu, rewriting our xTemplate them in phpTemplate, hardcoding menu, etc) we decided we would try to get Nick Lewis' phpTemplate menu (http://www.dynamicdrive.com/dynamicindex1/hvmenu/index.htm) working in xTemplate. Not sure this is feasible... Anyway, we've got the css stuff working but want to find a hack that would allow us to run a php snippet in the appropriate place in the template.
Under the existing <tr> for the logo and primary and secondary menus we were thinking of doing something like:
<tr><td colspan="2" class="topmenu">test<?php
$TheMenu = theme_menu_tree(17);
print $TheMenu;
?> </td></tr>
Can we create a {mymenu} that would run this code snippet?
Or is there a different way we can do this using xTemplate?
Advice welcome. (Yeah, we should have figured out menuing before doing theme in xTemplate, but we're newbies...)
Cheers,
Joe Murray, PhD President, JMA Consulting 57 Grandview Ave, Toronto, Ontario, Canada M4K 1J1 416.466.1281, 416.466.1277 (f) joe.murray@jmaconsulting.biz Skype: josephpmurray
Thanks for your generous reply, Ber.
We were hoping for a three level dynamic drop down solution similar to what jsDOMenu provides vertically. We love the integration of taxonomy_menu and the existing menu admin interface, and were hoping to dynamically populate the new system for one menu-oriented vocabulary. The site is built using the CivicSpace 0.8.2 installer, with CiviCRM upgraded to 1.3, so it's Drupal 4.6.
Perhaps I'll go back and look at Primary and Secondary Links, but they didn't seem to provide functionality of the sort we were looking for in 4.6.
As an update, due to tight timelines we've shifted to a different menuing solution that is unfortunately not integrated with Drupal's taxonomy. Would love to revisit this in future projects.
Cheers,
Joe
-----Original Message----- From: themes-bounces@drupal.org [mailto:themes-bounces@drupal.org] On Behalf Of Bèr Kessels Sent: January 4, 2006 5:26 PM To: A list for theme developers Subject: Re: [themes] Dynamic horizontal taxonomy menu with xTemplate
In 4.7 this is all handled in core. It has been quite well documented in the code so I suggest you read the example code in the core themes in HEAD and the functions in menu.module
Pre 4.6 I developed a module called primary_links to handle this. But as the name "module" indicates it is quit "bolted on". You can use it well, but I suggest you best not use it when you distribute the sites for people that will have to built there own menus afterwards. For your own development it should work without any problems.
both the 4.7 and primary links solutions are a lot better controllable by themes. And both use the menu UI to define the links. In combination with taxonomy_menu.module you will not even have to hand-manage the menus!
Ber
Op woensdag 04 januari 2006 00:12, schreef Joe Murray:
I'm working with some graphic designers who are still coming up to speed on Drupal. We're trying to create a horizontal menu
with data from a taxonomy.
It's three deep. Ideally the first level would be horizontal, the second and third would be vertical, ie, the menu options drop down, and then if there is a third level it comes out and drops
down again.
After looking at a number of options (eg. jsdoMenu, rewriting our xTemplate them in phpTemplate, hardcoding menu, etc) we decided we would try to get Nick Lewis' phpTemplate menu
(http://www.dynamicdrive.com/dynamicindex1/hvmenu/index.htm) working
in xTemplate. Not sure this is feasible... Anyway, we've
got the css
stuff working but want to find a hack that would allow us
to run a php
snippet in the appropriate place in the template.
Under the existing <tr> for the logo and primary and
secondary menus
we were thinking of doing something like:
<tr><td colspan="2" class="topmenu">test<?php
$TheMenu = theme_menu_tree(17);
print $TheMenu;
?> </td></tr>
Can we create a {mymenu} that would run this code snippet?
Or is there a different way we can do this using xTemplate?
Advice welcome. (Yeah, we should have figured out menuing
before doing
theme in xTemplate, but we're newbies...)
Cheers,
Joe Murray, PhD President, JMA Consulting 57 Grandview Ave, Toronto, Ontario, Canada M4K 1J1 416.466.1281, 416.466.1277 (f) joe.murray@jmaconsulting.biz Skype: josephpmurray
themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
Op donderdag 05 januari 2006 02:30, schreef Joe Murray:
Perhaps I'll go back and look at Primary and Secondary Links, but they didn't seem to provide functionality of the sort we were looking for in 4.6.
No you seem to miss the point. primary_links.MODULE has very little to do with primary links, other then that they share the name.
you can make, if you wish, 100 levels deep nested menus with that. Or even deeper.
bèr