[support] [Fwd: HTML displayed as text]

Steve Edwards killshot91 at comcast.net
Mon Mar 24 01:08:11 UTC 2008


Well, I figured out that what I needed to do was to pass the $html parameter as TRUE to the l() function.

The next problem is creating the path for the src parameter in the <img> tag.  I want to make it dynamic and use $base_path and 
$directory, but they don't seem to be available within my mytheme_menu_links() function.  Is there a way to make them available 
within the function?

Thanks.

Steve

-------- Original Message --------
Subject: HTML displayed as text
Date: Sun, 23 Mar 2008 14:26:52 -0700
From: Steve Edwards <killshot91 at comcast.net>
To: support at drupal.org

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



More information about the support mailing list