[development] HTML in node titles for D5

Yuval Hager yuval at avramzon.net
Sun Jan 20 05:12:21 UTC 2008

On Sunday 20 January 2008, Andrew ft wrote:
> Please tell me if this is a bad idea, but how about this as a solution:
> If you are only interested in minimal markup, like the ability to use the
> <em> tag, what about using a special character to indicate it in the node
> title, and then processing the title at the theme layer (for example with a
> regular expression) to convert the characters into tags.
> For example, you could use Hello *World!* as the node title and then
> convert this with a simple regular expression to Hello <em>World!</em> when
> the node is rendered.
> This would have the added advantage of keep clean the RSS feed from the
> node. It would also be much shorter than putting markup in the title,
> bearing in mind the 255 char limit.
> Would this be classified as a hack?

That's a very good idea! It has the advantage that in all places that output 
check_plain($node->title) will show a reasonable string after all. 
As long as the required markup is limited - this is the most elegant solution 
I've seen!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.drupal.org/pipermail/development/attachments/20080120/8b8084e0/attachment.pgp 

More information about the development mailing list