1267 Posts in 351 Topics by 486 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 3208 Views |
-
if ($Title=="My Home"){...}

26 February 2010 at 12:24am
DEar all, I'm very new to silverstripe...
I would like to find out what's the way to write the condition like this?if ($Title=="My Home"){...}
Hope you can share...
Thanks!
-
Re: if ($Title=="My Home"){...}

26 February 2010 at 7:36am Last edited: 26 February 2010 7:37am
Hi
welcome to SS the greatest CMS ever developed by humankind.
here is how you do it.
<% if Title == "My Home" %>
yo stuff here
<% else %>
second option
<% end_if %>hope it will help
P
-
Re: if ($Title=="My Home"){...}

26 February 2010 at 10:24am
To check for equality, use = instead of ==. AFAIK spaces won't work either, so you better check the URLSegment or similar.
Something like this:<% if URLSegment = my-url-segment %>
<% end_if %>
If you really want to check the title, create a custom function for it on your controller
-
Re: if ($Title=="My Home"){...}

23 September 2010 at 3:42am
just want to +1 that URLSegment is the way to go with these.
-
Re: if ($Title=="My Home"){...}

7 April 2011 at 2:43am
Hi all!
How to check this condition:
if ($Photo.Width > 100){...}
Thanks!
| 3208 Views | ||
|
Page:
1
|
Go to Top |




