Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vincent DeCapite 64 posts 83 karma points
    Apr 13, 2011 @ 21:09
    Vincent DeCapite
    0

    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:

    <%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    </asp:Content>

    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

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 13, 2011 @ 21:27
    Tom Fulton
    0

    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

  • Vincent DeCapite 64 posts 83 karma points
    Apr 13, 2011 @ 21:48
    Vincent DeCapite
    0

    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

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 13, 2011 @ 22:15
    Tom Fulton
    0

    I think there is an extra paranthesis on Node.GetCurrent()) - try removing it?

    -Tom

Please Sign in or register to post replies

Write your reply to:

Draft