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.

All other Modules /

Discuss all other Modules here.

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

How do i check that i am in the home page


Go to End


4 Posts   1922 Views

Avatar
kheeteck

Community Member, 7 Posts

16 June 2009 at 9:24pm

Is there a way to check if i am in the home page in the template file?

I am trying to

<% if Home %>

do something

<%end_if%>

Avatar
(deleted)

Community Member, 473 Posts

16 June 2009 at 9:32pm

<% if URLSegment = home %>
do stuff
<% end_if %>

should do it.

Avatar
kheeteck

Community Member, 7 Posts

16 June 2009 at 10:00pm

Hi,
Thanks so much for your help it works :)

One last qn,

How do i get the url link for Home, and the title of the home link?

Thanks

Avatar
(deleted)

Community Member, 473 Posts

16 June 2009 at 10:02pm

<% control Page(home) %>$Link is the link, $Title or $MenuTitle is the title<% end_control %>