I have created a new XSLT file using the in-built sitemap template and created a macro which uses this XSLT file. I have tried adding the macro to a content page but nothing is displayed. I've used the exact same process in another site and it works fine.
I have duplicated the working sitemap exactly several times but I can't get it to display anything - any suggestions?
Yes it created a matching macro which I tried adding to the page content.
Is it a requirement to have all the pages nested within a folder at the root level for the sitemap to display? Moving the pages to a folder fixed the problem.
Content -- Home -- Folder1 ---- About -------- About 1 -------- About 2 ---- Projects -------- Project 1 -------- Project 2 ---- Contact ---- Privacy
The sitemap only appears when I have the pages within Folder1. The Home page needs to be outside of this (and be the first page at root level) for the default page to display correctly. So the Home page doesn't actually appear in the sitemap which isn't what I wanted but at least the rest of the site is displayed.
Can you paste your code down here to have a look?..that's weird you are not getting anything?.....are you calling your macro in your template or in a richTexteditor?
Thanks for the reply Fuji. I would like my home page to be at the same level as the other pages. Is it by design that all pages need to be created as child nodes of the home page?
For example, why doesn't the sitemap work when I have this structure:
in-built sitemap template not displaying 4.5.2
Hi,
I have created a new XSLT file using the in-built sitemap template and created a macro which uses this XSLT file. I have tried adding the macro to a content page but nothing is displayed. I've used the exact same process in another site and it works fine.
I have duplicated the working sitemap exactly several times but I can't get it to display anything - any suggestions?
Hi Claire,
When creating the site map did it create its own macro?
//fuji
Yes it created a matching macro which I tried adding to the page content.
Is it a requirement to have all the pages nested within a folder at the root level for the sitemap to display? Moving the pages to a folder fixed the problem.
Claire can you send me how you website is set up??
Content
Homepage etc....
fuji
Hi Fuji,
Site structure below:
Content
-- Home
-- Folder1
---- About
-------- About 1
-------- About 2
---- Projects
-------- Project 1
-------- Project 2
---- Contact
---- Privacy
The sitemap only appears when I have the pages within Folder1. The Home page needs to be outside of this (and be the first page at root level) for the default page to display correctly. So the Home page doesn't actually appear in the sitemap which isn't what I wanted but at least the rest of the site is displayed.
Any ideas what I'm doing wrong?
OK i have the same strucuture quite the same structure as yours.
You can try this out
Thanks for the reply Fuji. Tried replacing my code with yours but I still get an empty listing :(
Hi Claire,
Can you paste your code down here to have a look?..that's weird you are not getting anything?.....are you calling your macro in your template or in a richTexteditor?
//fuji
Hi Fuji,
The macro is added to a page with the RTE via the Insert Macro icon. The xslt file contents:
<!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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<!-- update this variable on how deep your site map should be -->
<xsl:variable name="maxLevelForSitemap" select="4"/>
<xsl:template match="/">
<div id="">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@isDoc and @level=1]"/>
</xsl:call-template>
</div>
</xsl:template>
<xsl:template name="drawNodes">
<xsl:param name="parent"/>
<!-- Testing for protection -->
<xsl:if test="umbraco.library:IsProtected($parent/@id,
$parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id,
$parent/@path) = 1 and umbraco.library:IsLoggedOn() = 1)">
<ul>
<xsl:for-each select="$parent/* [@isDoc and @level <= $maxLevelForSitemap]">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/></a>
<xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1' and @level <= $maxLevelForSitemap]) > 0 and $currentPage/showInSiteMap = 1">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</xsl:if>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
The structure of my site is the same as posted above.
HI Claire,
I have just tested your sitemap code in an XSLT and it is returning me all the links nodes under this structure/
- Content
-- HOME
--- Page 1
--- Page 2
--- Page 3
//fuji
Thanks for the reply Fuji. I would like my home page to be at the same level as the other pages. Is it by design that all pages need to be created as child nodes of the home page?
For example, why doesn't the sitemap work when I have this structure:
-Content
--Home
--Page1
--Page2
--Page3
is working on a reply...