I'm relatively new to Drupal 7 and I'm a little lost on this one.

I have an "event" Content Type that contains a list field type that displays about five "location" options. Here they are, in key|label form:

Main Entrance|Main Entrance

School Entrance|School Entrance

Park Entrance|Park Entrance

Staff Entrance|Staff Entrance

What I'd like to do is directly link each label to a PDF file containing a map of the entrance location; e.g., Staff Entrance|<a href="filepath">Staff Entrance</a>.

When I try to customize the field settings, Drupal tells me that the following tags are allowed in labels: <a> <b> <big> <code> <del> <em> <i> <ins> <pre> <q> <small> <span> <strong> <sub> <sup> <tt> <ol> <ul> <li> <p> <br> <img>. But in spite of my efforts to add tags to labels, Drupal changes them to HTML entities and ignores them; e.g., &lt;Staff Entrance&gt;. This is the case for all HTML tags.

Is there a reason HTML is not rendering in my labels?



1 Answer 1


My guess is that a label can't be an anchor (because of XSS). You may want to use theme_preprocess_field or theme_preprocess_node to wrap the label with an anchor.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.