Redirect in href always including current parent path
I am trying the href links to a different part of the site (redirect) and am having issues in xslt - it always puts the current website/parent nodes/ before any path. What I want is to eliminate the current /parent nodes/ to leave just the website/ and add the passed in path to the url. So for example - it is rendering:
I don't know exactly what you want but do you mean that when you click the link generated by <xsl:value-of select="$urlRedirect"/> the problem starts? maybe to simple but it might be just a '/' before the url.
Redirect in href always including current parent path
I am trying the href links to a different part of the site (redirect) and am having issues in xslt - it always puts the current website/parent nodes/ before any path. What I want is to eliminate the current /parent nodes/ to leave just the website/ and add the passed in path to the url. So for example - it is rendering:
href="localhost/current parent/new node path"
and what I want is
href="localhost/new node path"
Here is the macro code
<xsl:variable name="urlRedirect" select="/macro/urlClassicRoot"/>
<xsl:variable name="nodeTypeAlias" select="$currentPage/node[$pos]/@nodeTypeAlias"/>
<xsl:choose>
<xsl:when test="$nodeTypeAlias = 'Classic' ">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlRedirect"/>
</xsl:attribute>
<xsl:value-of select="$currentPage/node[$pos]/data [@alias = 'FriendlyName']/text()"/>
</xsl:element>
</xsl:when>
<xsl:otherwise >
<a href="{umbraco.library:NiceUrl($currentPage/node[$pos]/@id)}">
<xsl:value-of select="$currentPage/node[$pos]/data [@alias = 'FriendlyName']/text()"/>
</a>
</xsl:otherwise>
</xsl:choose>
I tried this using an <a href> instead of <xsl:element> and had no luck there either.
Any ideas would be greatly appreciated!
Thanks,
Mike
I don't know exactly what you want but do you mean that when you click the link generated by <xsl:value-of select="$urlRedirect"/>
the problem starts? maybe to simple but it might be just a '/' before the url.
Ron
Perhaps I'm not understanding the question, but if you want a simple redirect add a property to the documentType called
with a data type of content picker, then the page will automatically redirect to the node picked using the content picker,
Thanks so much Ron - that was it! I can't believe I forgot the "/" at the beginning of the url!
Thanks guys!
Mike
is working on a reply...