21304 Posts in 5736 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 274 Views |
-
Page Accesss to Not Logged in viewers

2 May 2012 at 9:08am
Hi,
in the 'access' tab it's really easy to set a page so it can only be access by logged in members, or specific groups. But i'm wanting a page to only be visible (and shown in the menus) when the user is logged out.
Has anyone come across an easy solution for this?
-
Re: Page Accesss to Not Logged in viewers

2 May 2012 at 10:33am
In Page.ss:
<% if CurrentMember %>
<p>A logged in person can see this</p>
<% else %>
<p>A logged out person can see this</p>
<% end_if %>
Have fun!
Nova -
Re: Page Accesss to Not Logged in viewers

2 May 2012 at 10:42am
that will work for the page content itself, assuming the page has it's own page type and tempalte, but i'm really looking at something that will remove the item from the menu...
-
Re: Page Accesss to Not Logged in viewers

2 May 2012 at 11:04am
Yes you will need to either edit the existing Page.ss or create your own Page Type.
In Navigation.ss:
<% if CurrentMember %>
<ul>
<% control Menu(1) %>
<li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.XML</span></a></li>
<% end_control %>
</ul>
<% else %>
<ul>
<li><a href="">Viewable by Logged Out Link</a></li>
</ul>
<% end_if %>This can also be achieved other ways, I'm just trying to keep it simple.
-
Re: Page Accesss to Not Logged in viewers

2 May 2012 at 11:13am
thanks... You're example would replace the whole menu, which is fine if this is what you need. in my case i just have a few pages. However, you've got me thinking, and I think i'll just need to add another tickbox to the behaviour tab, and then do something like this
<ul>
<% control Menu(1) %>
<% if CurrentMember %>
<% if DontShowToLoggedInMemebers %>
<% else %><li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.XML</span></a></li>
<% end_if %>
<% else %><li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><span>$MenuTitle.XML</span></a></li>
<% end_if %>
<% end_control %>
</ul>that should work! thanks
-
Re: Page Accesss to Not Logged in viewers

2 May 2012 at 11:16am
Yeah was thinking something similar. Good luck!
| 274 Views | ||
|
Page:
1
|
Go to Top |


