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.
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.
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:
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)
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?
Redirect page to email address link
How can I "Redirect Hyperlink" to an email address link rather than a page?
JV,
Do you want to create a mail hyperlink? If so, you can use:
Or did I misunderstand the question?
Cheers,
/Dirk
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
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
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.
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 " "> ]>
<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>
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
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
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.
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.
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?
Take a look at reCAPTCHA's Mailhide offering...
http://mailhide.recaptcha.net/
Nice!
Thanks Lee, will be implementing that for sure.
Cheers,
JV
is working on a reply...
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.