[support] HTML displayed as text

Eric McKenna eric.mckenna at gmail.com
Mon Mar 24 15:48:42 UTC 2008


use theme_image to create your image source.  For the path, use
path_to_theme() . "/images/yourimage.png"

Another option entirely, is to create your own theming function.  I
like to do this when I have a totally separate primary links section.

themename_do_my_links($links) { ... }

then in page.tpl.php file use theme("do_my_links", $primary_links) for
the main nav items

This makes it easy to separate display of your primary links with any
other menus you have.


On Mon, Mar 24, 2008 at 10:25 AM, Steve Edwards <killshot91 at comcast.net> wrote:
> I tried doing that, but I haven't had any luck with that.  Would I use
>  the background-image property for the list item?  Or is there a better
>  property to use?
>
>  Steve
>
>
>
>  Michael Prasuhn wrote:
>  > While this isn't exactly the answer to your question, which I see that
>  > you found on your own. I would definitely recommend doing the image
>  > replacement via CSS, so that print and screen reading versions of your
>  > site don't have any loss of experience. In my experience this also is
>  > better for browsers that have images turned off as well.
>  >
>  > -Mikey P
>  >
>  >
>  > On Mar 23, 2008, at 2:26 PM, Steve Edwards wrote:
>  >
>  >> I'm trying to edit my primary links menu to replace the text with a
>  >> button image, and I'm having a problem with getting my <img>
>  >> tag to display.  I've overridden the theme_menu_links() function in
>  >> template.php, and it looks like what I need to do is replace
>  >> $link['title'] with the <img> tag.  To do this, I added this line to
>  >> the function:
>  >>
>  >> $link['title'] = "<img src=\"images/btn_home.jpg\">";
>  >>
>  >> However, the whole tag is displayed as text on the page, and when I
>  >> view source, this is what I see for the link:
>  >>
>  >> <li><a href="/drupal57/" title="Home page" class="active">&lt;img
>  >> src=&#039;images/btn_home.jpg&#039;&gt;</a></li>
>  >>
>  >> I don't understand this, because in other places in the function,
>  >> that is how tags are written out in the code.  What do I need to
>  >>  change to get the actual quotes and < > symbols written out
>  >> correctly?
>  >>
>  >> Thanks.
>  >>
>  >> Steve
>  >> --
>  >> [ Drupal support list | http://lists.drupal.org/ ]
>  >>
>  >
>  > __________________
>  > Michael Prasuhn
>  > mike at mikeyp.net
>  > http://mikeyp.net
>  > 949.200.7595
>  > 714.356.0168 cell
>  > 949.200.7670 fax
>  >
>  >
>  >
>  --
>  [ Drupal support list | http://lists.drupal.org/ ]
>


More information about the support mailing list