21288 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1035 Views |
-
Testing if on homepage

2 September 2010 at 10:04pm
Hi,
Possibly dumb question, but is there a means of testing for whether the current page is the homepage? I'd like to modify the behaviour of an include for when on the homepage, and don't really want to create a homepage specific include to do the job. Something like
<% if home %>
...
<% endif %>Been through the docs, but see nothing obvious... but then I'm still acclimatising to silverstripe
Thanks in advance
Rob
-
Re: Testing if on homepage

4 September 2010 at 2:54am
Thanks... However
<% if URLSegment = 'home' %>
<% end_if %>
generates a syntax error due to an unexpected '}', which is odd.
If I remove the quotes from 'home', then all works OK.
Cheers
Rob
| 1035 Views | ||
|
Page:
1
|
Go to Top |


