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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Specific value IF statement

Go to End



Community Member, 30 Posts

1 December 2009 at 2:32am

I want to be able to make an IF statement based on the value of the field entered in the cms.
The field I have is a drop down, so it's controllable to an extent.

I currently have a filedataobjectmanager where one of the values is a catogory.
I've then got a jqury filtering system setup where the files are filtered by download categories.

What I want to acheive is to only show the filter button for file types which are there, so I never have an empty area.

I'm thinking something along these lines:

<ul id="downloads-menu">
	<li class="title">Select Type</li>
		<li class="current"><a href="#nogo">All</a></li>
		<% if Category(financial-information) %><li><a href="#nogo">Financial Information</a></li><% end_if %>
		<% if Category(management-information)  %><li><a href="#nogo">Management Information</a></li><% end_if %>
		<% if Category(uk-specific)  %><li><a href="#nogo">UK Specific</a></li><% end_if %>

How would I acheive this. I know "<% if Category(uk-specific) %>" doesn't work - but what will?

Cheers! :D