HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Creating a log out button at the .global_zone

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#35597 (In Topic #8028)
Avatar

Fan in action

Creating a log out button at the .global_zone

Hi all, how to go about in creating a button for logout at the .global_zone class. Thanks in advance.
Reasons for doing that:
1. User need not to go back to the <Home> page to logout
2. Able to logout in any zones.
 
Back to the top
 
Posted
Rating:
#35604
Avatar

Put an HTML link into the TOP template at an appropriate position.

Code

<a href="{$PAGE_LINK*,:login:logout}">Logout</a>


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#35613
Avatar

Community saint

Nice 'ask', thesea. Thanks.
Nice solution Chris (of course). I tried it and it works.
Just in case anyybody else is following the thread, I was encouraged to add it to my Admin Zone 'zone menu', and it works there as well.

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#35615
Avatar

Fan in action

Cool. hahaz Thanks Chris
Back to the top
 
Posted
Rating:
#35619
Joe
Avatar

Honoured member

Fletch said

Just in case anyybody else is following the thread, I was encouraged to add it to my Admin Zone 'zone menu', and it works there as well.

Zone menu? Aren't the menu's the same for every zone? o_O


Back to the top
 
Posted
Rating:
#35631
Avatar

Community saint

Joe said

Zone menu? Aren't the menu's the same for every zone? o_O

Yes, and No!

The "Admin Zone" zone menu was a recent introduction and isn't activated by default.

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#35633
Joe
Avatar

Honoured member

Are you referring to the Management Navigation? :P

I must be missing out on something here. :/

Back to the top
 
Posted
Rating:
#35639
Avatar

Community saint

Joe said

I must be missing out on something here. :/

Probably.

Take a look at topic #28145 on this page.




Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#35640
Avatar

Fan in action

To all, I am unsure of where to place this line of code. Can someone please direct me to do so? When i put at the top template, it appears after the [edit menu] and when I press it, yes, it will logout but the logout button still appears at the home page. Shouldn't the logout button appears only when user has login?
Back to the top
 
Posted
Rating:
#35643
Avatar

This'll answer your second query…

Code

{+START,IF,{$NOT,{$IS_GUEST}}}
<a href="{$PAGE_LINK*,:login:logout}">Logout</a>
{+END}

For the first, try the MENU_ZONE template.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#35651
Avatar

Fan in action

 Sorry if i have asked a dumb question =) But i tried it out, yes both can work, but how come when i'm at admin zone, the logout button does not have a "|" infront but when i log in as a normal user, there is a "|" infront? I tried to type in the "|" infront but it turns out the admin account has a "| logout" but the normal account will have a "| | logout". Please give me some direction to do it. Thanks in advance, and i apologies for giving more and more questions on this topic.

PS: i edit the code at the menu_zone template
 
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: