I have a form that I want to optionally put help text on each field. The most flexible way to set this up (i.e., so I can delegate the writing of the help text to a writer) is to make the help text a message that can be managed through the i18n system. Not every field will have helptext, so I only want to render the help link (a "?" to pop up the helptext) if the help text is set.
However, when rendering a template, #strings# aren't expanded in tags, so you can't do logic with them.
What I ended up with is this, which is kind of ugly:
<% if {[lang::message::message_exists_p [ad_conn locale] mysite.$elements(id)_help]} { %>
Help: #mysite.@elements.id@_help#
<% } else { %>
No help available.
<% } %>
Is there a cleaner way to accomplish this switching on message existence?