I have 2 different items that I may or may not want to put in the <property name="header_stuff"> tag at the top of an ADP page. Each of the items should be present only if a certain condition is true.
I tried the obvious first:
<property name="header_stuff">
<if @condition_1@>Item 1</if>
<if @condition_2@>Item 2</if>
</property>
Unfortunately, that doesn't work since ADP tags aren't evaluated inside a <property> tag, they're just spit out to the page.
So I could either
- Make 4 different <property> tags and then do a complex set of if/then's to decide which one to output.
- Do the evaluation in the tcl page and have a simple <property name="header_stuff">@item_1@@item2@</property> tag, but this would mean putting HTML markup in the TCL file.
- Maybe there's a third way I'm not thinking of?
To see the real-world example, look at
Weblogger's index.adp page. Someone used Method #1 to conditionally add the RSS <link>, but this could get really ugly as I I'm trying to add a conditional
RSD link, which would make the if/then situation twice as complex.
I'm leaning toward Method #2 - any suggestions?