I have this weird situation. I have a regex that is working perfectly in paint layout, but failing in design file ..... Here is the snippet of code I am using in Design file ...
<MySource_AREA id_name="is_city_cairns" design_area="show_if">
<MySource_SET name="condition" value="keyword_regexp"/>
<MySource_SET name="condition_keyword" value="%asset_url%"/>
<MySource_SET name="condition_keyword_match" value="^[a-z,0-9,\-,\.,/,:]*cairns[/,\-,a-z]+" />
<MySource_THEN>The city is Cairns</MySource_THEN>
<MySource_ELSE>%asset_url%</MySource_ELSE> <!-- Just for Testing URL -->
</MySource_AREA>
The above code always print the ELSE part ...... Why ????
Try removing the percentage signs from the value="%asset_url%" part, so just use value="asset_url"
Does that help?
Thanks Bart, Worked perfectly ..... So never use % when comparing "condition_keyword" value in a "show-if" design area ? Right ? or does this rule (no % sign) applies to all design areas ?
And depending on what you are printing and testing conditions on, it might be easier to do the check inside a standard page and then nest that into the design.