| | | | | |
How can I forward a menu option/group to another location?
You can forward a group (option on the menu) to a different area of the site by adding a simple script to an article.
For example you may want to have an area e.g.Students located in 2 different areas of your site structure but wish to direct them to one area for information about that topic so you don't have to duplicate the material. Another example where this might be used is when you which to move the location of one of the system pages, e.g.if you wish to move the monthly calendar from below the 'Home' menu to a more prominent place within your site's navigation structure.
Both these examples would be achieved in the following way:
- Copy the url location of the page you wish to direct the user to e.g.if you were wishing to add an option for the monthly calendar you would go to the monthly calendar and copy the url from the address bar of your browser i.e./Calendar/Month.aspx .
Note: if you are forwarding to a page on your web site you don't need to include your domain name, you only need the part of the address after your domain name. This is called a relative link and means if would work even if you changed your site domain name.
- Create a group that you want to setup the forward within. e.g.if wishing to move the location of the monthly calendar you would create a new group for the monthly calendar in the position you require within your site structure.
- Create an article within the newly created group and add the script to an article. First create a new article within your newly created group. When the document editor loads select the 'Source' option from the editor's toolbar (it's the last option on the far-right of the toolbar options). Replace the text that appears in the 'source' with the following code:
Forward Scripts There are two options for linking to a web page from your menu bar.
- You can make the user go straight to the link from your site in the same window.
- You can choose to open the link in a new window so a user remains on your site in the original browser window.
Replacing your page with the page you are linking to Paste in the script below replacing the URL (in red) with the URL you wish to forward to.
<script type="text/javascript"> if (window.location.href.indexOf('/aspnet_client/') < 0){ window.location = "/Group/Group.aspx?ID=18617"; } </script>
Opening the link in a new window To add a script that will open the link in a new window please use the code below replacing the URL in red with the address you wish to forward your user to.
<script type="text/javascript"> if (window.location.href.indexOf('/aspnet_client/') < 0){ window.open("Group/Group.aspx?ID=18617"); history.go(-1); }</script>
Note: A user's browser settings may block a link opened in a new window if they have pop-up blocker enabled in their browser.
- Publish your article, giving it a name.
- Make your article a group homepage article by clicking on the house icon in the documents tab to the right of the document title. Your newly created group should now forward you to your new location.
Note:The forward will only work if you have a layout with an Article component set to display the group homepage
- Your forward should now be complete - test it and see.
|
|
|
|
|