I am on umbraco version 4.0.3. We have a template call Link that gives the user an option to create a heading navigation to link to an external page. Problem is I have tried everything and can't get it working. The template itself is empty. The field of the external link is call externalLink. All it contains is this:
Another school of thought is to adjust your navigation menus to write out the link to the external page directly in the menu (instead of using a redirect on a template). I posted an example in this thread. The first solution might be easier though as you don't need to modify all of your navigation macros.
Thanks for this, I went ahead and tried this and I get a compilation error at this line:
Line 7: { Line 8: // Get the current page Line 9: Node currentNode = Node.GetCurrent()); Line 10: // verify that the property "URL" is not null and that it is not empty; then redirect Line 11: if (currentNode.GetProperty("URL") != null
Help with external link template
Hi There,
I am on umbraco version 4.0.3. We have a template call Link that gives the user an option to create a heading navigation to link to an external page. Problem is I have tried everything and can't get it working. The template itself is empty. The field of the external link is call externalLink. All it contains is this:
I have no idea how to call it so that when the link is clicked it automatically loads the external page say yahoo.com..
Any help with this will be greatly appreciated.
Thanks
Hi Vincent,
There's a wiki article explaining how to do this from your template: http://our.umbraco.org/wiki/how-tos/telling-a-page-to-redirect-to-an-external-url
Another school of thought is to adjust your navigation menus to write out the link to the external page directly in the menu (instead of using a redirect on a template). I posted an example in this thread. The first solution might be easier though as you don't need to modify all of your navigation macros.
Hope this helps,
Tom
Thanks for this, I went ahead and tried this and I get a compilation error at this line:
Line 7: {
Line 8: // Get the current page
Line 9: Node currentNode = Node.GetCurrent());
Line 10: // verify that the property "URL" is not null and that it is not empty; then redirect
Line 11: if (currentNode.GetProperty("URL") != null
I think there is an extra paranthesis on Node.GetCurrent()) - try removing it?
-Tom
is working on a reply...