Hi,
Right now I have Log Off as permanent link in the nav bar. But how do I make that link only appear if someone is actually logged on?
Thanks!
Hi,
Right now I have Log Off as permanent link in the nav bar. But how do I make that link only appear if someone is actually logged on?
Thanks!
What did you do to get it to display as a permanent link in the first place?
20 years a Zencart User
It is in ezpages (page title Logoff) with yes to appear in the header and footer and an internal link to the logoff page.
What I would like to do is only have that link appear if someone is actually logged on.
Thanks.
You can surround the code for that link with an if test like
if ($_SESSION['customer_id']) {
... link code ...
}
Cool. Where do I put that bit of code?
ThanksCode:if ($_SESSION['customer_id']) { index.php?main_page=logoff }
Actually it may be a bit tricky.
You would put the if test around the entire code that outputs the link, not just the url snippet; but since this is an ez-pages menu, it is dynamic and there is not a fixed bit of code in the file to apply the switch to.
It might work to test the page ids as they are being processed by the output file(s) and skip the output if the current id is the same as the logoff page id. More research needs to be done for this.
Whoa... that sounds quite a bit more tricky. I was hoping I could just do something similar to the view cart and checkout now links which only appear the nav bar if something is placed in the cart...
Still, it seems like a handy piece of code (having log off only appear if someone is actually logged on)...
Thanks.
That code would be easy to apply to any element in the header navbar, because the link code is individually spelled out in the file. It is the same principle as is currently used in the header navbar area. Unfortunately, #navCatTabs and #navEZPagesTop are dynamic.
Yeah I can see where that might throw a wrench in the works. Oh well... it was a good thought. :-)
Thanks.
What's the URL?
Please do not PM for support issues: a private solution doesn't benefit the community.
Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.
Bookmarks