Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
I created a website with Home,Product,Gallery,Enquiry,contactus pages. I want to create a sitemap page also. How can i create it with umbraco?
Thanks in advance,
Hari
Try searching the forums. Like http://our.umbraco.org/forum/developers/xslt/17660-create-a-sitemap-from-site-structure
If this is not what you are after please reply.
Hi Hari,
The best way of doing is by creating an XSLT file and from the Choose a Template drop down menu choose SiteMap.
This should work and is straight forward.
//fuji
Hi Skiltz thanks for ur reply, I created the sitemap.xslt in the xslt files and also created a macro for it and used it in my sitemap page. But it doesn't work.
I created the menubar navigation in my pages by this way,
<ul class="navigation"><li class="current"><a href="Home.aspx"><em class="home"></em><b>Home</b></a></li><li><a href="Product.aspx?GroupID=1"><em class="templates"></em><b>Products</b></a></li><li><a href="#"><em class="psd"></em><b>PhotoGallery</b></a></li><li><a href="contact.aspx"><em class="contact"></em><b>ContactUs</b></a></li><li><a href="#"><em class="shop"></em><b>Sitemap</b></a></li><li><a href="Enquiry.aspx"><em class="tutorials"></em><b>Enquiry</b></a></li></ul>
How can i create the sitemap with this?
Hi Fuji thanks for ur reply, Help me with the same problem..
Did you get it working??
No it doesn't working..
Weird, can you show us how you structured your Content section and the code of the XSLT?
My sitemap template look like follows,
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %><asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server"> <umbraco:Item field="bodyText1" runat="server"></umbraco:Item></asp:Content>
code in xslt is,
<?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" 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="sitemap"> <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"/> <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 string(umbracoNaviHide) != '1' 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"> <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>
I placed the sitemap macro in the editor. but it doesn't work.
Hi Hari, Can you show us how you structured your content section?
Your site map looks good to me. Do you have your content section like this
Content
-Default
-- Node 1
-- Node 2
Try adding the macro directly in your template as a test to see the output.
a
Take a look at examples
https://github.com/umbraco/Umbraco-CMS/tree/dev-v7/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates
Backoffice: Settings -> Partial View -> Create -> Choose snippet
This is how I was able to implement a dynamic sitemap on my Umbraco 7.7.9 installation:
Step-by-step tutorial here: https://blog.nicolaayan.com/2018/03/generate-an-umbraco-sitemap/
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to create a sitemap?
Hi all,
I created a website with Home,Product,Gallery,Enquiry,contactus pages. I want to create a sitemap page also. How can i create it with umbraco?
Thanks in advance,
Hari
Try searching the forums. Like http://our.umbraco.org/forum/developers/xslt/17660-create-a-sitemap-from-site-structure
If this is not what you are after please reply.
Hi Hari,
The best way of doing is by creating an XSLT file and from the Choose a Template drop down menu choose SiteMap.
This should work and is straight forward.
//fuji
Hi Skiltz thanks for ur reply, I created the sitemap.xslt in the xslt files and also created a macro for it and used it in my sitemap page. But it doesn't work.
I created the menubar navigation in my pages by this way,
<ul class="navigation">
<li class="current"><a href="Home.aspx"><em class="home"></em><b>Home</b></a></li>
<li><a href="Product.aspx?GroupID=1"><em class="templates"></em><b>Products</b></a></li>
<li><a href="#"><em class="psd"></em><b>PhotoGallery</b></a></li>
<li><a href="contact.aspx"><em class="contact"></em><b>ContactUs</b></a></li>
<li><a href="#"><em class="shop"></em><b>Sitemap</b></a></li>
<li><a href="Enquiry.aspx"><em class="tutorials"></em><b>Enquiry</b></a></li>
</ul>
How can i create the sitemap with this?
Hi Fuji thanks for ur reply, Help me with the same problem..
Did you get it working??
No it doesn't working..
Weird, can you show us how you structured your Content section and the code of the XSLT?
My sitemap template look like follows,
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
<umbraco:Item field="bodyText1" runat="server"></umbraco:Item>
</asp:Content>
code in xslt is,
<?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" 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="sitemap">
<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"/>
<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 string(umbracoNaviHide) != '1' 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">
<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>
I placed the sitemap macro in the editor. but it doesn't work.
Hi Hari, Can you show us how you structured your content section?
Your site map looks good to me. Do you have your content section like this
Content
-Default
-- Node 1
-- Node 2
Try adding the macro directly in your template as a test to see the output.
a
Take a look at examples
https://github.com/umbraco/Umbraco-CMS/tree/dev-v7/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates
Backoffice: Settings -> Partial View -> Create -> Choose snippet
This is how I was able to implement a dynamic sitemap on my Umbraco 7.7.9 installation:
Step-by-step tutorial here: https://blog.nicolaayan.com/2018/03/generate-an-umbraco-sitemap/
is working on a reply...