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.

Template Questions /

<% IF $URL doesn't include 'Security' ....


Reply


6 Posts   922 Views

Avatar
Futureweb

Community Member, 233 Posts

1 August 2011 at 10:17pm

Hi,

I've added a log in form etc to the header of my site (munromap.co.uk) by adding $LoginForm. All good.

However, if the user ends on original SS login page (links, incorrect password etc) then there are TWO login forms on the page - and the CSS is getting all messed up

I would like, on the /Security/ pages, to not show the log in page in the header - not just hide it via css, but actually not show it, so there aren't duplicated bits of forms around...

Any suggestions?

Avatar
swaiba

Forum Moderator, 1799 Posts

1 August 2011 at 11:21pm

Probably best to do the logic of the if within php, rather than with the tempate...

template.ss

<% if SecurityLoginPage %>
<% else %>
//show form
<% end_if %>

Page.php

function SecurityLoginPage() {
return (strpos($_GET['url'],'Security')!==false); //note untested!
}

Avatar
Willr

Forum Moderator, 5513 Posts

3 August 2011 at 7:18pm

Or you can use ClassName (saves adding that method)

<% if ClassName = Security %>
<% else %>
...
<% end_if %>

Avatar
Futureweb

Community Member, 233 Posts

3 August 2011 at 7:51pm

Edited: 03/08/2011 7:56pm

Hi Willr - just tried that - sounds easier, but it made no change...

page just putting $ClassName on the page, i saw that the 'Security' pages are simply classname 'Page'...

so ended up using the function above - work fine...

Avatar
zenmonkey

Community Member, 528 Posts

4 August 2011 at 5:55am

Security Pages have an ID of 0 so you could filter for if ID=0

Avatar
martimiz

Forum Moderator, 1105 Posts

4 August 2011 at 8:27am

I think you can filter on <% if URLSegment != Security %> ... <% end_if %>