Hi;
#1:
I want to add a login/logout link to my main navigation - wondering what is the best way to approach this:
I’m using wayfinder to build the menus, I was thinking I just wanted a menu item that says login for anonymous users and once a user logs in I wanted it to change to logout...
I thought I could do this with resource groups, but apparently there is a lot of extra setup there - is there a more efficient way of doing this?
#2:
I’m having some really strange behaviour happening with the member only pages [2]
- I have the user groups/resource groups/conteexts etc all setup and seem to be working just fine.
- I have about 20 pages that don’t belong to a resource group [anonymous] and 2 pages that beloong to members
- in my main navigation for a not logged in user, everything turns up correctly
- when I click on the "login" link - which is just an anonymous page calling my [[$UserLogin]] chunk - I get referred to the login page [correct] but the main navigation then displays the 2 member only resources I have created BEFORE I log in!
-- If I navigate away from the login page with OR without logging in the member resources disappear
-- If I try to click on the member page without logging in I get the default 404 page
-- If I log in and click on the member resource, I get the correct page....!
This is really strange, I have cleared session, caches, logged in & out, tried different browsers and cleared their caches and cookies ... something is really weird about that login page as it always shows the member only resource links, logged in or not! [I’ve even tried removing all the access stuff and went through setting it up again - no dice]
anyone have any ideas on that??
-thanks
-sean
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
-
☆ A M B ☆
- 3,141 Posts
#2: do you call your menu uncached?
#1: you could set a conditional pagetitle.. like this:
[[+modx.user.id:notempty=`Logout`:default=`Login`]]
Looks a bit funny in the back-end navigation tree, but worked last time I tried
Thanks Mark;
I disabled all the caching and it seems to be fine now - will just have to remember to enable it all when it goes live.
as for the login link - thanks, it’s not pretty, but it gives me an idea, maybe I can modify some of the wayfinder presentation chunks/templates to detect this....
-thanks
-sean
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
-
☆ A M B ☆
- 3,141 Posts
You’ll need to keep the menu uncached if you want it to change based on a user session.. if you cache the call, it will be cached on the first view and not reflect who is actually viewing at that point.
this is the wayfinder parameter for caching you are talking about [&cacheResults]??
I don’t see anything specific in the admin->settings->cache settings about menus....
[what are the valid values for &cacheResults? is default true or false, or 1 or 0? ]
-thanks
-sean
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
-
☆ A M B ☆
- 3,141 Posts
I mean using:
[[!Wayfinder?...]]
instead of
[[Wayfinder?...]]
I haven’t used the &cacheResults parameter myself so no idea from the top of my mind
oooohhhh yeah... I remember coming across that little trick at some point, just didn’t ’click’
-thanks
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525