I would love a little help setting up the ability to inject spans and imgs into a menu item anchor tag. I have been able to acheive this by hacking the common.inc file on line 1081 from:
return '<a href="'. check_url(url($path, $query, $fragment, $absolute)) .'"'. drupal_attributes($attributes) .'>'. ($html ? $text : check_plain($text)) .'</a>';
to:
return '<a href="'. check_url(url($path, $query, $fragment, $absolute)) .'"'. drupal_attributes($attributes) .'>'. ($html.$text) .'</a>';
I would like some help doing this with a module or via phpTemplate. Ideally though, I would like another input in the menu form to inject whatever html you might need rather than just including it as part of the anchor text (menu title).
The reason for wanting to do all this is that it would enable people to use Eric Meyer's pure css popups.
Thanks,
Comments
Hi Jon, Here is something
Hi Jon,
Here is something you could try, fell free to correct me if I am going down the wrong path:
In template.php file within your theme add:
then create a new file called menu_item_link.tpl.php:
In theory that should allow you to have html such as spans in your links.
You may have to change the filter settings to allow spans also.
Hope that helps
Tony.
-----------------------
www.csscreator.com
Thanks, Tony. I'll give that
Thanks, Tony.
I'll give that a shot.
Jon Hancock
Chuck Norris CAN believe it's not butter!
Well, Tony, unfortunately,
Well, Tony, unfortunately, that seems to make the menus dissapear all together.
Jon Hancock
Chuck Norris CAN believe it's not butter!
Hi Jon, instead of return
Hi Jon,
instead of return try print in menu_item_link.tpl.php:
print l($item['title'], $link_item['path'], isset($item['description']) ? array('title' => $item['description']) : array(), NULL, NULL, FALSE, TRUE);
www.csscreator.com
New attempt
Hi Jon,
Ok after a little playing around I found another way to do this.
in template.php add
then in menu_item_link.tpl.php add
Hope this one works.
I put an x in the span so you could easily see that something was happening.
www.csscreator.com