Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Conditional construction in ss files


Go to End


2 Posts   1997 Views

Avatar
Victor

Community Member, 128 Posts

26 March 2009 at 10:35am

I have a CustomPage which basically displays

$position $honors

and I want that if (and only if)

 $honors!=''

it returned

$position, $honors

(so inserted , )

Is it possible? Thank you in advance

Victor

Avatar
Victor

Community Member, 128 Posts

26 March 2009 at 1:08pm

$position<% if honors %>, <% end_if %>$honors