<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2>You might consider abandoning the primary links construct
and just create a custom region for your theme and put the primary links block
in that region. If the "menu-block" gives you what you wan't that
might work. You then disable primary and secondary links in the menu.
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2>That being said. It sounds like your problems are
that your javascript is doing a a lot of DOM walking specific stuff (otherwise
why would extra divs be a problem?). Is that accurate? This is part
of what JQUERY was written for. In JQUERY you can bind to on-click events using
typical CSS selectors. That rocks for this kind of work (even if I don't
do a ton of it). </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2>I realize that you have some already tested code. But
if it's highly specified to the organization of the document it could cause you
a lot of problems in the long run, so I thought you'd want to know about
JQuery. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2>Hope some of this helps anyway. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2>Dave</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=361485619-17082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> support-bounces@drupal.org
[mailto:support-bounces@drupal.org] <B>On Behalf Of
</B>sander-martijn<BR><B>Sent:</B> Thursday, August 16, 2007 5:15
PM<BR><B>To:</B> support@drupal.org<BR><B>Subject:</B> Re: [support] Menu
question<BR></FONT><BR></DIV>
<DIV></DIV>Making some progress here. I've realized that to some extent
what I want to do is override theme_menu_tree and theme_menu_item. That
gives me some of the control I need BUT the default menu system still has extra
junk I don't want (such as a Primary links header) AND I need two types of menu
trees that display different things - one horizontal in the top (primary links)
and one vertical down the left (current section and its children).
<BR><BR>so far i think menus are a pain in the ass in drupal. a tradeoff
for the power but I think the multiple meanings that the word "menu" has in
drupal just adds to the confusion of it all. What I need is really not
that complicated, but it's becoming incredibly complicated
fast.<BR><BR>sander-martijn wrote:
<BLOCKQUOTE cite=mid:46C4D024.8030207@sander-martijn.com type="cite"><PRE wrap="">I want to customize my menus, but since I want it to work with the
html/css/javascript code I've already written and tested I want to get
the system to output the menu in html as I want it. Actually what I
need is quite simple. I don't really want to try to customize someone
else's module and I'd rather not build one. After some digging around I
figured out that I could override the theme_menu_links method in my
template.php file. Now that's exactly what I need... I got really
excited but I must have some things missing/misunderstood.
what I have in the menu system under primary links:
primary links
- menu item 1
- menu 1 subitem 1
- menu 1 subitem 2
- menu item 2
- menu 2 subitem 1
etc - fairly standard
What I need to output is the following:
<ul id="nav1" class="nav">
<li><a href="#">menu item 1</a>
<ul>
<li><a href="#">menu 1 subitem 1</a></li>
<li><a href="#">menu 1 subitem 2</a></li>
</ul>
</li>
</ul>
<ul id="nav2" class="nav">
<li>menu item 2
<ul>
<li><a href="#">menu 2 subitem 1</a></li>
</ul>
</li>
</ul>
etc. - also pretty straight forward.
SO - I put in page.tpl.php the following:
<?php print theme('menu_links', $primary_links); ?>
and put in template.php the following:
function tpg_menu_links($links){
if (!count($links)) {
return '';
}
$level_tmp = explode('-', key($links));
$level = $level_tmp[0];
$output = "<ul id=\"nav\" class=\"nav\">\n";
foreach ($links as $index => $link) {
$output .= "<li>". l($link['title'], $link['href'],
$link['attributes'], $link['query'], $link['fragment']) ."</li>\n";
}
$output .= '</ul>';
return $output;
}
?>
Which is basically a modified version of theme_menu_links in menu.inc
It works as a start, but there are a couple of issues.
1. even though my class attribute in $output is hard coded, it's still
being replaced by class="active" when you're on the page. Not a
disaster, i can always modify my css to do the same thing for
class="active" as class="nav".
2. this is the bigger issue. It's not outputting the subitems. I'd be
happy to add in the proper call in the foreach loop to either call
another function that i also override or to load them directly in here
if anyone can point me in the direction of what i need to call in order
to load them.
</PRE></BLOCKQUOTE><BR>
<DIV class=moz-signature>-- <BR>
<HR align=center width="100%" noShade SIZE=1>
<P
style="FONT-WEIGHT: normal; FONT-SIZE: 10px; TEXT-TRANSFORM: lowercase; COLOR: rgb(51,51,51); FONT-STYLE: normal; FONT-FAMILY: verdana,arial,helvetica,sans-serif; TEXT-ALIGN: center"><A
style="COLOR: rgb(0,0,255); FONT-FAMILY: verdana,arial,helvetica,sans-serif; TEXT-DECORATION: none"
href="mailto:sander@sander-martijn.com">sander-martijn</A><BR>interface
developer | architect<BR><A
style="COLOR: rgb(0,0,255); FONT-FAMILY: verdana,arial,helvetica,sans-serif; TEXT-DECORATION: none"
href="mailto:sander@sander-martijn.com">sander@sander-martijn.com</A><BR><A
style="COLOR: rgb(0,0,255); FONT-FAMILY: verdana,arial,helvetica,sans-serif; TEXT-DECORATION: none"
href="http://www.sander-martijn.com">www.sander-martijn.com</A> </P>
<HR align=center width="100%" noShade SIZE=1>
</DIV></BODY></HTML>