Create a main navigation link which redirects to an arbitrary location AND maintain control of the portal_tab order
Purpose
If a link is added using portal_actions this link would be displayed in the navigation before content items such as the News and the Events Folders. Another way to approach this problem would be to add a Link to the site root, but this would require two clicks to travel to the destination page. This How-to explains one way to have a link displayed in portal_tabs which opens immediately and is order-able.
2 Use Cases as Examples:
- A link to contact-info which is nested between News and Events
- A link to an external url which is nested between News and Events
Step By step
- Create a folder in the root of the Plone site. The Title will be the name of the link such as 'Contact'.
- Now open the ZMI add a DTML Document to the folder you just created.
- Give the DTML Document an id and a Title, and choose 'Save and Edit'.
- Paste in this code, and tweak as needed, to create the DTML redirect for an internal link:
<dtml-var standard_html_header> <dtml-let target="portal_url() + 'contact-info'"> <h1><a href="<dtml-var target>"><dtml-var target></a>.</h1> <dtml-call expr="RESPONSE.redirect(target)"> </dtml-let> <dtml-var standard_html_footer>
For an external link use code like this:
<dtml-var standard_html_header> <dtml-let target="'http://www.google.com'"> <h1><a href="<dtml-var target>"><dtml-var target></a>.</h1> <dtml-call expr="RESPONSE.redirect(target)"> </dtml-let> <dtml-var standard_html_footer>
- Now, in the ZMI go to the 'Properties' tab of the folder containing the DTML Document.
- Add a new property with the 'Name' of default_page and the 'Type' of string and the 'Value' of the id for the DTML Document.
The link should now work!
Optional: Prevent the view of this folder from ever being able to be changed
1. In the ZMI go to the Security tab of the new folder that was created.
2. Uncheck 'Acquire permission settings' for the permission 'Modify view template' and make sure no checkboxes are checked for this permission.
Further information
There are a handful of ways that this can be accomplished. It would be interesting to see how others have approached this problem.

Author: