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.

General Questions

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

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

Using InSection for admin


Reply

5 Posts   1047 Views

Avatar
sca123

1 August 2009 at 3:48am Community Member, 61 Posts

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

Thanks

Avatar
Double-A-Ron

1 August 2009 at 9:01am Community Member, 604 Posts

Hi there,

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

Cheers
Aaron

Avatar
sca123

2 August 2009 at 4:13am Community Member, 61 Posts

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

2 August 2009 at 9:02pm Forum Moderator, 1091 Posts

Something like this?

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

Avatar
sca123

3 August 2009 at 8:18am Community Member, 61 Posts

Thank you. This works 100%