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.

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

Using InSection for admin


Go to End


5 Posts   1469 Views

Avatar
sca123

Community Member, 61 Posts

1 August 2009 at 3:48am

How would I use <% if InSection(page-url) %> for the admin/log in page.

Thanks

Avatar
Double-A-Ron

Community Member, 607 Posts

1 August 2009 at 9:01am

Hi there,

It might help to explain exactly what you are trying to do.

Cheers
Aaron

Avatar
sca123

Community Member, 61 Posts

2 August 2009 at 4:13am

Thanks for your reply.

Nothing really difficult. The login page uses page.php template. This template has a side menu, which does not appear on the login page (as it does not have a "section"). This means that the formatting of the page goes a little odd with the login form appearing over the left hand side menu area.

All I was going to do is load some other code to stop this happening IF its the login page.

Hope that is clear - let me know if not.

Avatar
martimiz

Forum Moderator, 1391 Posts

2 August 2009 at 9:02pm

Something like this?

<% if ElementName != Security %>
...
<% end_if %>

Avatar
sca123

Community Member, 61 Posts

3 August 2009 at 8:18am

Thank you. This works 100%