Copied to clipboard

Flag this post as spam?

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


  • syn-rg 282 posts 425 karma points
    Mar 22, 2010 @ 07:27
    syn-rg
    0

    Redirect page to email address link

    How can I "Redirect Hyperlink" to an email address link rather than a page?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Mar 22, 2010 @ 08:51
    Dirk De Grave
    0

    JV,

    Do you want to create a mail hyperlink? If so, you can use:

    <a href="mailto:<email here>" />

     

    Or did I misunderstand the question?

     

    Cheers,

    /Dirk

  • syn-rg 282 posts 425 karma points
    Mar 22, 2010 @ 23:44
    syn-rg
    0

    Sorry Dirk,

    No it's not as simple as that. I want to be able to add links into my footer nav that link directly to email links.

    Hence I would like to create a node that links can be redirected to an email link, or to any external website page. eg: http://www.google.com

    Hope this makes sense.

    Cheers,

    JV

  • Jan Skovgaard 11280 posts 23678 karma points MVP 12x admin c-trib
    Mar 23, 2010 @ 00:10
    Jan Skovgaard
    0

    Hi JV

    If I understand you correctly I think the easiest and most flexible approach in this case would be to define a rich text editor property on for instance your frontpage document type where you can the make a list of links, which can be inserted into your footer. Within the Rich Text Editor you have the possibility to insert e-mail links, internal links and external links.

    /Jan

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Mar 23, 2010 @ 00:31
    Lee Kelleher
    0

    Hi JV,

    Do you already have a document-type for your "Redirect Hyperlink" nodes?  If so, what have you called the property/field for the link?

    Are you using an XSLT/macro to display the navigation?  If so, could you provide a snippet of the XSLT? One of us should be able to help you out.

    Basically whatever property/field you use in your "Redirect Hyperlink" document-type, just output that as your URL/link in your XSLT.

    Let us know.

    Cheers, Lee.

  • syn-rg 282 posts 425 karma points
    Mar 23, 2010 @ 00:52
    syn-rg
    0

    Hi Lee,

    i'm not using a document type, just "umbracoRedirect".

    Here's a snippet of the footer navigation:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library"
        exclude-result-prefixes="msxml umbraco.library">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <xsl:call-template name="drawNodes"> 
    <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::node [@level=1]"/> 
    </xsl:call-template>

    </xsl:template>

    <xsl:template name="drawNodes">
    <xsl:param name="parent"/>
    <xsl:for-each select="$parent/node [string(./data [@alias='footerMenu']) = '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true())]">
    <li><a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName" />
    </a></li>
    </xsl:for-each>
    </xsl:template>

    </xsl:stylesheet>

  • Jan Skovgaard 11280 posts 23678 karma points MVP 12x admin c-trib
    Mar 23, 2010 @ 00:57
    Jan Skovgaard
    0

    I'm not sure that what you are trying to do is possible...

    Are you sure that what you need to do is make an anchor, that directs people to your e-mail link in your footer?

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 12x admin c-trib
    Mar 23, 2010 @ 00:59
    Jan Skovgaard
    0

    The umbracoRedirect is for a page redirect. You can read a bit more about it's usage in here http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbracoredirect

  • syn-rg 282 posts 425 karma points
    Mar 23, 2010 @ 01:11
    syn-rg
    0

    Thanks Jan,

    I'm not sure if it's possible either, I haven't found anything that would allow such a thing.

    Ideally the footer links would redirect to external web pages or email addresses. However I'm not adding these manually to the template as I am applying user role protection to some of these links. So that only certain member types can see these links.

    At the moment they are linking to an internal page, then the external link is on this page. Which although is a solution, is not ideal, and does not work as nicely as the above suggestion would.

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Mar 23, 2010 @ 01:27
    Lee Kelleher
    1

    Hey JV,

    I'd suggest that you do the following... on your document-type, add a new property/field with an alias of "externalUrl".  On your content nodes, add whatever you want to use... URLs, mailtos, etc.

    Then in your XSLT, replace the <li> tags (and everything inside it) with this:

    <li>
        <a>
            <xsl:attribute name="href">
                <xsl:choose>
                    <xsl:when test="string(data[@alias='externalUrl']) != ''">
                        <xsl:value-of select="data[@alias='externalUrl']" />
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="umbraco.library:NiceUrl(@id)" />
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:attribute>
            <xsl:value-of select="@nodeName" />
        </a>
    </li>

    This snippet is checking if the property "externalUrl" has a value, if so - then it uses it ... otherwise it falls-back on the NiceUrl.

    For email addresses, remember to put the "mailto:" prefix/protocol in there.   Personally I never use mailto links - spambot thrive off them - I generally go for a contact form ... much safer.  Take a look at the Cultiv Contact Form, or the CWS (which contains loads of extra functionality)

    Cheers, Lee.

  • syn-rg 282 posts 425 karma points
    Mar 23, 2010 @ 01:46
    syn-rg
    0

    Awesome! Thanks Lee, that works perfectly.

    I'll be sure to use your advice about mailto links, as we don't want to receive bundles of spam. Does anyone think using TinyURL links instead of mailto is a smart option?

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Mar 23, 2010 @ 01:51
    Lee Kelleher
    0

    Take a look at reCAPTCHA's Mailhide offering...

    http://mailhide.recaptcha.net/

  • syn-rg 282 posts 425 karma points
    Mar 23, 2010 @ 02:02
    syn-rg
    0

    Nice!

    Thanks Lee, will be implementing that for sure.

    Cheers,
    JV

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies