With regards to the top Nav's HOME link, I would like to be able to get a parent page property and use that in the <a href="/">Home</a> section rather than hardcoding to the root of the site, like
Please note though, that this usually gives you a URL like this: /sitename - which (if it's the same location as the root, i.e., if you only have a single site in your install) can give you duplicate content issues with the GoogleBot.
Node 1 & two have a property called siteRoot. What I would like to happen on the Top nav is when HOME is clicked default node above the preivous page using the siteRoot value on the node. Tried below but when using the visualize xslt the hyperlink is ...../umbraco/developer/xslt and doesn't have the siteRoot value?
That's happening because if you link like this: <a href="go-here"> - this is a relative link, so the browser will add it to the URL of whichever page you're currently on.
So you'll have to write an absolute link, which is easily done by adding the http:// to it, like this:
XSLT Top nav
Hi All,
With regards to the top Nav's HOME link, I would like to be able to get a parent page property and use that in the <a href="/">Home</a> section rather than hardcoding to the root of the site, like
<a href="parentssiterootproperty ">Home</a>
Any help would be appreciated, thanks.
<ul id="topNavigation">
<li class="home">
<xsl:if test="$currentPage/@id = $currentPage/ancestor-or-self::* [@level=$level]/@id">
<xsl:attribute name="class">home current</xsl:attribute>
</xsl:if>
<xsl:variable name="URL">
<xsl:value-of select="pageTitle"/>
</xsl:variable>
<a href="/">Home</a>
Hi Mark,
You can grab it like this:
- or, if parentPageProperty is a NodePicker (i.e. it only contains an ID):
Please note though, that this usually gives you a URL like this: /sitename - which (if it's the same location as the root, i.e., if you only have a single site in your install) can give you duplicate content issues with the GoogleBot.
/Chriztian
Hi Chriztian,
Thanks for the prompt reply. The node structure I have is like the following
Content - Node 1 - Page1
--------------------------- Page 2
----------------------------Page3 etc
Content - Node 2 - Page 1
-------------------------- -Page 2
----------------------------Page 3 etc
Node 1 & two have a property called siteRoot. What I would like to happen on the Top nav is when HOME is clicked default node above the preivous page using the siteRoot value on the node. Tried below but when using the visualize xslt the hyperlink is ...../umbraco/developer/xslt and doesn't have the siteRoot value?
Any thoughts??
<ul id="topNavigation">
<li class="home">
<xsl:if test="$currentPage/@id = $currentPage/ancestor-or-self::* [@level=$level]/@id">
<xsl:attribute name="class">home current</xsl:attribute>
</xsl:if>
<a href="{$currentPage/../siteRoot}">Home</a>
I've managed to get the parentsproperty value back using
<ahref="{$currentPage/../parentPageProperty}">Home</a>
However the url is
http:/siteroot/currentpage/parentproperty
how do I get the url to be just
http://siteroot/parentproperty
Most things I've tried says out of scope
Hi Mark,
That's happening because if you link like this: <a href="go-here"> - this is a relative link, so the browser will add it to the URL of whichever page you're currently on.
So you'll have to write an absolute link, which is easily done by adding the http:// to it, like this:
/Chriztian
Worked like a treat. Thanks for all your help Chriztian
is working on a reply...