I have a container for a user menu and one of the options I want is just for logging out. I figure a symlink is great for this since I'll just link to the "login" page which uses the Login snippet with "service=logout" for the attributes.
My issue is that, ok so I set the ID of the document to open, and create the attribute, but a few things don't make sense:
1) There is still a freeze URI option which seems to override the purpose of a symlink in the first place, I can put whatever I want in here and then the ID and attributes on the first tab are ignored.
2) Regardless if I use the main tab or the freeze URI option, the actual link looks like "/index.html?id=14". Shouldn't it instead point to the actual page or URI? This can be a problem should somebody copy the link or somehow create a bookmark or something this way. And why aren't the attributes in that link? I set an attribute of "service=logout" but it doesn't show up when I hover over this link in the browser, is it POSTed or something?
3) My symlink is in a container, so it is actually pointing to the wrong document when I use it. In other words, I want to reach "/login.html?service=logout" but the actual URI it goes to is "/parent/login.html?service=logout".
4) I thought perhaps I didn't need a symlink, but a weblink. I tried to use a weblink instead but this seems to force me to use a response code like 301 moved. I don't want a response code, I don't want weird looking links, I don't want funny business in how the link is displayed to users, all I want is just to link to another page!
Assuming I don't want to hard-code the link, I'd rather let wayfinder build the menu; how can I just put a link that looks, behaves and performs like a regular old link?
This might be what you want (replace 12 with the ID of the Login page):
<a href="[[~12? &service=logout]]">Logout</a>
I've seen this code used. It sounds like you tried it (though you're missing the first 'a' in your example above):
<a href="[[~12]]&service=logout">Logout</a>
The link produced by Login itself looks like this on my localhost site (the site is in the addons subdirectory just below the web root):
<a href="/addons/login.html?service=logout" title="Logout">Logout</a>
-
☆ A M B ☆
- 24,524 Posts
Maybe it should be
[[~12? &service=`logout`]]