For the internal link (parent node linking to first child node) you may want to look into the reserved property alias umbracoRedirect. If you create a property on your doc type of type content picker, with the alias umbracoRedirect then Umbraco will automatically redirect you to the linked node, so if on your parent node you define the property and set it to the first child node beneth it whenever anybody clicks on the parent node it will actually link you to the first child instead.
External URLs are a little bit trickier. For this I would probably define a property on your doc type of type Textstring with an alias of something like externalUrl. Then in your XSLT for you navigation, when creating the links, check to see if that property is set:
And another great thing would be use umbracoRedirect directly to a media file. To get a direct download through main menu or a PDF document. Is this possible now?
I can't say I've tried linking direct to a media item. My initial thoughts would be that it wouldn't work, but by all means give it a try.
The neehouse macro would also be a good solution. You may need to update it, but as always, there are many ways to do the same thing so whatever works best for you. I have a redirect macro that I use a lot of the time, just create a user control with the following codebehind
public partial class RedirectControl : System.Web.UI.UserControl { public bool RedirectToUrl { get; set; } public string RedirectUrl { get; set; } public bool RedirectToPage { get; set; } public int RedirectPage { get; set; } public bool RedirectToFirstChild { get; set; } public bool IsPermanent { get; set; }
protected void Page_Init(object sender, EventArgs e) { if (RedirectToUrl) DoRedirect(RedirectUrl);
If you make this into a Macro and define all the fields at the top as properties, you can either drop it in your template or in a richtextarea and set how you want it to redirect.
I'd still do something in your nav macro to do the external redirect though as that would prevent you from having to go to the actual page first, but this makes for a good backup.
Runaway dropdown navigation URL link and disable
Hi guys, i was trying to add an some items to my content tree that only act as a parent with 3 sub level, but the parent didn't link to anything.
Furthermore, i would like to use some menu items like links to other URL outside website. Is this possible?
Thank you for your help guys.
regards
Hi Javier,
This is sertainly possible yea.
For the internal link (parent node linking to first child node) you may want to look into the reserved property alias umbracoRedirect. If you create a property on your doc type of type content picker, with the alias umbracoRedirect then Umbraco will automatically redirect you to the linked node, so if on your parent node you define the property and set it to the first child node beneth it whenever anybody clicks on the parent node it will actually link you to the first child instead.
External URLs are a little bit trickier. For this I would probably define a property on your doc type of type Textstring with an alias of something like externalUrl. Then in your XSLT for you navigation, when creating the links, check to see if that property is set:
You may also want to create a macro to drop on the page just incase anybody gets to it directly.
Hope this gives you some idea on where to start.
Many thanks
Matt
Thank you Matt, umbracoRedirect Works very good. And for external links i have found this:
http://www.neehouse.com/umbraco_cms/packages/redirect.aspx It works on 4.0.4.2.
And another great thing would be use umbracoRedirect directly to a media file. To get a direct download through main menu or a PDF document. Is this possible now?
i think no, because u tried everything
Hi Javier,
I can't say I've tried linking direct to a media item. My initial thoughts would be that it wouldn't work, but by all means give it a try.
The neehouse macro would also be a good solution. You may need to update it, but as always, there are many ways to do the same thing so whatever works best for you. I have a redirect macro that I use a lot of the time, just create a user control with the following codebehind
If you make this into a Macro and define all the fields at the top as properties, you can either drop it in your template or in a richtextarea and set how you want it to redirect.
I'd still do something in your nav macro to do the external redirect though as that would prevent you from having to go to the actual page first, but this makes for a good backup.
Matt
is working on a reply...