<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sure, glad to provide it.&nbsp; Here's how my theme function ended up:
<br>
<br>
function mytheme_menu_links($links) {
<br>
&nbsp;global $base_path;
<br>
&nbsp;$directory = drupal_get_path('theme','mytheme');
<br>
&nbsp;if (!count($links)) {
<br>
&nbsp;&nbsp; return '';
<br>
&nbsp;}
<br>
&nbsp;$level_tmp = explode('-', key($links));
<br>
&nbsp;$level = $level_tmp[0];
<br>
&nbsp;$output = "&lt;ul class=\"links-$level\"&gt;\n";
<br>
&nbsp;foreach ($links as $index =&gt; $link) {
<br>
&nbsp;&nbsp; $link['html'] = TRUE;
<br>
&nbsp;&nbsp; $output .= '&lt;li';
<br>
&nbsp;&nbsp; if (stristr($index, 'active')) {
<br>
&nbsp;&nbsp;&nbsp;&nbsp; $output .= ' class="active"';
<br>
&nbsp;&nbsp; }
<br>
&nbsp;&nbsp; switch ($link['title']){
<br>
&nbsp;&nbsp;&nbsp;&nbsp; case "Home":
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $button = "&lt;img
src=\"".$base_path.$directory."/images/btn_home.jpg\"
height=\"40\"&gt;";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $img_class = "home";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
<br>
&nbsp;&nbsp;&nbsp;&nbsp; case "About the Center":
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $button = "&lt;img
src=\"".$base_path.$directory."/images/btn_about.jpg\"&gt;";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $img_class = "about";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
<br>
&nbsp;&nbsp;&nbsp;&nbsp; case "Sponsors":
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $button = "&lt;img
src=\"".$base_path.$directory."/images/btn_sponsors.jpg\"&gt;";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $img_class = "sponsors";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
<br>
&nbsp;&nbsp;&nbsp;&nbsp; case "Board of Directors":
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $button = "&lt;img
src=\"".$base_path.$directory."/images/btn_board.jpg\"&gt;";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $img_class = "board";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
<br>
&nbsp;&nbsp;&nbsp;&nbsp; case "Resources":
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $button = "&lt;img
src=\"".$base_path.$directory."/images/btn_resources.jpg\"&gt;";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $img_class = "resources";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
<br>
&nbsp;&nbsp;&nbsp;&nbsp; case "News":
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $button = "&lt;img
src=\"".$base_path.$directory."/images/btn_news.jpg\"&gt;";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $img_class = "news";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; case "Store":
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $button = "&lt;img
src=\"".$base_path.$directory."/images/btn_store.jpg\"&gt;";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $img_class = "store";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;
<br>
&nbsp;&nbsp;&nbsp;&nbsp; case "Contact":
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $button = "&lt;img
src=\"".$base_path.$directory."/images/btn_contact.jpg\"&gt;";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $img_class = "contact";
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp; &nbsp;&nbsp; }
<br>
&nbsp;&nbsp; $output .= ' class = "';
<br>
&nbsp;&nbsp; $output .= $img_class;
<br>
&nbsp;&nbsp; $output .= '"&gt;'. l($button, $link['href'], $link['attributes'],
$link['query'], $link['fragment'], $link['absolute'], $link['html'])
."&lt;/li&gt;\n";
<br>
&nbsp;}
<br>
&nbsp;$output .= '&lt;/ul&gt;';
<br>
<br>
&nbsp;return $output;
<br>
}
<br>
<br>
It's probably not as pretty as it could be since I hardcoded the image
names for the buttons, but I'm not real good with regex stuff, so this
will do.&nbsp; Also, one thing that is left out in this chain was that I had
to add the $link['html'] parameter to the l() function (it's at the top
of the for loop to generate each item) so that my &lt;img&gt; tags
would be written out as HTML.&nbsp; Notice that I also added a class to the
&lt;li&gt; tag for each item so that I could specifically target it
with CSS.
<br>
<br>
Another interesting thing that I discovered has to do with the CSS to
display the buttons.&nbsp; For some reason (and if somebody could explain
this, that would be great), getting the buttons to display inline
without any spaces between them didn't work with this CSS:
<br>
<br>
ul.links-menu li {
<br>
&nbsp;display:inline;
<br>
&nbsp;list-style-type:none;
<br>
}
<br>
<br>
This left spaces between the images (making it too wide for the page),
even when there was no padding or margins set on any of the selectors.&nbsp;
With the help of a designer friend of mine, I changed it to
<br>
<br>
ul.links-menu li {
<br>
&nbsp;display:block;
<br>
&nbsp;float:left;
<br>
&nbsp;list-style-type:none;
<br>
}
<br>
<br>
and they display just fine.
<br>
<br>
As for the mouseover functionality, I haven't been able to get that to
work yet.&nbsp; I've tried using a:hover with my class selector that I
added, like this:
<br>
<br>
li.home a:hover {
<br>
&nbsp;background-image: url(images/btn_homeup.jpg);
<br>
}
<br>
<br>
but no dice.&nbsp; If anyone has a suggestion for doing this, I'm all ears.
<br>
<br>
Steve
<br>
<br>
<br>
Brett Evanson wrote:
<blockquote
 cite="mid:972255370803281455v293690feu2bf33bf72db47c1d@mail.gmail.com"
 type="cite">Steve,<br>
  <br>
I'm trying to do something just like this, and I was wondering if you
had a chunk of code you wouldn't mind sharing? Also, did you get the
mouse over to work? I could help with that, if I had something to start
with. I have done this, but I've always done it as a hack, and not as a
theme function.<br>
  <br>
Brett Evanson<br>
  <br>
  <div class="gmail_quote">On Mon, Mar 24, 2008 at 10:04 AM, Steve
Edwards &lt;<a moz-do-not-send="true"
 href="mailto:killshot91@comcast.net">killshot91@comcast.net</a>&gt;
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Actually,
that's what I did. &nbsp;I put a copy of theme_menu_links() in<br>
template.php and renamed it to mytheme_menu_links(), and then in<br>
page.tpl.php I changed it to<br>
    <br>
theme('menu_links', $primary_links);<br>
    <br>
and that's worked pretty well. &nbsp;Now all I have to do is get a mouseover<br>
effect to work and get the images aligned properly.<br>
    <br>
If anybody is curious to see this and has any suggestions, I'm working<br>
on the page at <a moz-do-not-send="true"
 href="http://dev.capusfiresafety.org" target="_blank">http://dev.capusfiresafety.org</a>
(Drupal), and trying to<br>
get it to look like <a moz-do-not-send="true"
 href="http://www.campusfiresafety.org" target="_blank">http://www.campusfiresafety.org</a>
(non-Drupal).<br>
    <br>
Thanks.<br>
    <font color="#888888"><br>
Steve<br>
    </font>
    <div>
    <div class="Wj3C7c"><br>
Eric McKenna wrote:<br>
&gt; use theme_image to create your image source. &nbsp;For the path, use<br>
&gt; path_to_theme() . "/images/yourimage.png"<br>
&gt;<br>
&gt; Another option entirely, is to create your own theming function. &nbsp;I<br>
&gt; like to do this when I have a totally separate primary links
section.<br>
&gt;<br>
&gt; themename_do_my_links($links) { ... }<br>
&gt;<br>
&gt; then in page.tpl.php file use theme("do_my_links", $primary_links)
for<br>
&gt; the main nav items<br>
&gt;<br>
&gt; This makes it easy to separate display of your primary links with
any<br>
&gt; other menus you have.<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Mar 24, 2008 at 10:25 AM, Steve Edwards &lt;<a
 moz-do-not-send="true" href="mailto:killshot91@comcast.net">killshot91@comcast.net</a>&gt;
wrote:<br>
&gt;<br>
&gt;&gt; I tried doing that, but I haven't had any luck with that.
&nbsp;Would I use<br>
&gt;&gt; &nbsp;the background-image property for the list item? &nbsp;Or is there
a better<br>
&gt;&gt; &nbsp;property to use?<br>
&gt;&gt;<br>
&gt;&gt; &nbsp;Steve<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp;Michael Prasuhn wrote:<br>
&gt;&gt; &nbsp;&gt; While this isn't exactly the answer to your question,
which I see that<br>
&gt;&gt; &nbsp;&gt; you found on your own. I would definitely recommend
doing the image<br>
&gt;&gt; &nbsp;&gt; replacement via CSS, so that print and screen reading
versions of your<br>
&gt;&gt; &nbsp;&gt; site don't have any loss of experience. In my experience
this also is<br>
&gt;&gt; &nbsp;&gt; better for browsers that have images turned off as well.<br>
&gt;&gt; &nbsp;&gt;<br>
&gt;&gt; &nbsp;&gt; -Mikey P<br>
&gt;&gt; &nbsp;&gt;<br>
&gt;&gt; &nbsp;&gt;<br>
&gt;&gt; &nbsp;&gt; On Mar 23, 2008, at 2:26 PM, Steve Edwards wrote:<br>
&gt;&gt; &nbsp;&gt;<br>
&gt;&gt; &nbsp;&gt;&gt; I'm trying to edit my primary links menu to replace
the text with a<br>
&gt;&gt; &nbsp;&gt;&gt; button image, and I'm having a problem with getting
my &lt;img&gt;<br>
&gt;&gt; &nbsp;&gt;&gt; tag to display. &nbsp;I've overridden the
theme_menu_links() function in<br>
&gt;&gt; &nbsp;&gt;&gt; template.php, and it looks like what I need to do is
replace<br>
&gt;&gt; &nbsp;&gt;&gt; $link['title'] with the &lt;img&gt; tag. &nbsp;To do
this, I added this line to<br>
&gt;&gt; &nbsp;&gt;&gt; the function:<br>
&gt;&gt; &nbsp;&gt;&gt;<br>
&gt;&gt; &nbsp;&gt;&gt; $link['title'] = "&lt;img
src=\"images/btn_home.jpg\"&gt;";<br>
&gt;&gt; &nbsp;&gt;&gt;<br>
&gt;&gt; &nbsp;&gt;&gt; However, the whole tag is displayed as text on the
page, and when I<br>
&gt;&gt; &nbsp;&gt;&gt; view source, this is what I see for the link:<br>
&gt;&gt; &nbsp;&gt;&gt;<br>
&gt;&gt; &nbsp;&gt;&gt; &lt;li&gt;&lt;a href="/drupal57/" title="Home page"
class="active"&gt;&amp;lt;img<br>
&gt;&gt; &nbsp;&gt;&gt;
src=&amp;#039;images/btn_home.jpg&amp;#039;&amp;gt;&lt;/a&gt;&lt;/li&gt;<br>
&gt;&gt; &nbsp;&gt;&gt;<br>
&gt;&gt; &nbsp;&gt;&gt; I don't understand this, because in other places in
the function,<br>
&gt;&gt; &nbsp;&gt;&gt; that is how tags are written out in the code. &nbsp;What
do I need to<br>
&gt;&gt; &nbsp;&gt;&gt; &nbsp;change to get the actual quotes and &lt; &gt;
symbols written out<br>
&gt;&gt; &nbsp;&gt;&gt; correctly?<br>
&gt;&gt; &nbsp;&gt;&gt;<br>
&gt;&gt; &nbsp;&gt;&gt; Thanks.<br>
&gt;&gt; &nbsp;&gt;&gt;<br>
&gt;&gt; &nbsp;&gt;&gt; Steve<br>
&gt;&gt; &nbsp;&gt;&gt; --<br>
&gt;&gt; &nbsp;&gt;&gt; [ Drupal support list | <a moz-do-not-send="true"
 href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a>
]<br>
&gt;&gt; &nbsp;&gt;&gt;<br>
&gt;&gt; &nbsp;&gt;<br>
&gt;&gt; &nbsp;&gt; __________________<br>
&gt;&gt; &nbsp;&gt; Michael Prasuhn<br>
&gt;&gt; &nbsp;&gt; <a moz-do-not-send="true" href="mailto:mike@mikeyp.net">mike@mikeyp.net</a><br>
&gt;&gt; &nbsp;&gt; <a moz-do-not-send="true" href="http://mikeyp.net"
 target="_blank">http://mikeyp.net</a><br>
&gt;&gt; &nbsp;&gt; 949.200.7595<br>
&gt;&gt; &nbsp;&gt; 714.356.0168 cell<br>
&gt;&gt; &nbsp;&gt; 949.200.7670 fax<br>
&gt;&gt; &nbsp;&gt;<br>
&gt;&gt; &nbsp;&gt;<br>
&gt;&gt; &nbsp;&gt;<br>
&gt;&gt; &nbsp;--<br>
&gt;&gt; &nbsp;[ Drupal support list | <a moz-do-not-send="true"
 href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a>
]<br>
&gt;&gt;<br>
&gt;&gt;<br>
--<br>
[ Drupal support list | <a moz-do-not-send="true"
 href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a>
]<br>
    </div>
    </div>
  </blockquote>
  </div>
  <br>
  <br clear="all">
  <br>
-- <br>
Brett Evanson<br>
  <a moz-do-not-send="true" href="mailto:brettev@gmail.com">brettev@gmail.com</a><br>
801-599-0584
</blockquote>
</body>
</html>