Redirect top menu item to a system page
I want a Top Menu Item called 'Member Login' to redirect to the 'Authorization Required' system page.
How do I do this?
-
ChrisH commented
Hi Anon,
I'd make use of the global javascript (Settings->Site->Global Javascript) and, in it, manipulate the top menu by appending a link to the /Sys/Login screen.There are a couple of ways to do this but the most straightforward is to go to the Website -> Template Pages.
Edit your standard page template.
Select the Horizontal Menu widget where you want your link to appear.
On the left, look @ the Advanced section and note the HTML ID. For my site, the ID is "id_yOhi7Wr"Next, go to your global Javascript area and plug in something like the following:
```
<script>
jq$(function(){
$('#id_yOhi7Wr .menuInner ul.firstLevel').append('<li><div class="item"><a href="/Sys/Login" title="Events"><span>Member Login</span></a></div></li>');
});
</script>```
-
Randall (Randy) Rensch commented
Hmm. The Wishlist system here seems to be changing a " to the HTML entity for it ("). Be sure to use the quotation mark instead. Single quotes might suffice.
-
Randall (Randy) Rensch commented
Apologies for a typo in the #1 code below. Should be:
<meta http-equiv="refresh" content="0;url=https://www.yourdomain.org/Sys/Login" />
BUT SEE THE WARNING IN MY INSTRUCTION BEFORE YOU USE IT.
And if moving to Trash, be sure you use the rightclick flyout next to the page in the list of pages. If you use the Move to Trash link button at the top of the dashboard, I fear you might instead delete the page the system redirected to, which could be your home page or whatever a 404 defaults to.
-
Randall (Randy) Rensch commented
I assume your reason for wanting this is that the login link is sometimes not noticed in the corner of the page? There may be better solutions for that, but here goes...
#1 is the cleaner for users, as it is more direct. However I would not use approach #1 without touching base with Support first. At least do it only during hours that you are sure of being able to reach support. I'll explain below.
1. Create a new page as usual. Create a Custom HTML gadget space on it. (A Custom Content gadget is optional.) Click the Edit Code button (at left) and insert a standard Refresh meta tag. (Putting it in the body is unorthodox, and is not optimum for SEO, but it will work.)
<meta http-equiv="refresh" content="0;url=https://www.yourdomain.org/Sys/Login/" />Put the page on your menu and when the user clicks it, they will
immediately be taken to the login page.
HOWEVER (IMPORTANT!)...
If you need to edit the page (e.g., error, change/add content), the page will redirect in the WA Site Pages editor (probably to your home page),
making editing it IMPOSSIBLE. It will redirect even if you have included a delay to give you time to click Edit! (Which would also delay it for users, so that's not a good idea.) If you must use this method for some reason, first save a version of the page without the meta tag (or comment it out), and then save the "final" version of the redirection page. Then if you need to edit it, rightclick to choose the earlier version (without the redirect), make your edits, including the meta tag with zero delay, and resave. If you've wound up with two redirect versions live (I haven''t tested that far), rightclick to delete the unwanted one. Whew!2. This approach is simpler, kosher, and barely more trouble for your members. They won't think it odd: Create a page with the login link and save it on your menu. Done. A user clicking on the menu will get your page, and when they click the link, it will go to the login form.
<a href="https://www.yourdomain.org/Sys/Login">LOGIN</br></a>
As always, have several people test, who are unfamiliar with what you are testing.
However, if you think (as I do) that regular communication with Members helps make them feel wanted, this may be a good excuse for a few lines in your newsletter or "letter from the President." Telling them how to login might be helpful. A lot of our members still think everyone has the same password which they have to remember.