Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Hari 21 posts 41 karma points
    Sep 20, 2011 @ 06:21
    Hari
    0

    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

  • skiltz 501 posts 701 karma points
    Sep 20, 2011 @ 06:49
    skiltz
    0

    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.

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 20, 2011 @ 07:08
    Fuji Kusaka
    0

    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

  • Hari 21 posts 41 karma points
    Sep 20, 2011 @ 07:11
    Hari
    0

    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"><href="Home.aspx"><em class="home"></em><b>Home</b></a></li>
    <li><href="Product.aspx?GroupID=1"><em class="templates"></em><b>Products</b></a></li>
    <li><href="#"><em class="psd"></em><b>PhotoGallery</b></a></li>
    <li><href="contact.aspx"><em class="contact"></em><b>ContactUs</b></a></li>
    <li><href="#"><em class="shop"></em><b>Sitemap</b></a></li>
    <li><href="Enquiry.aspx"><em class="tutorials"></em><b>Enquiry</b></a></li>
    </ul>

    How can i create the sitemap  with this?


  • Hari 21 posts 41 karma points
    Sep 20, 2011 @ 07:27
    Hari
    0

    Hi Fuji thanks for ur reply, Help me with the same problem..

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 20, 2011 @ 07:28
    Fuji Kusaka
    0

    Did you get it working??

  • Hari 21 posts 41 karma points
    Sep 20, 2011 @ 07:41
    Hari
    0

    No it doesn't working..

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 20, 2011 @ 07:44
    Fuji Kusaka
    0

    Weird, can you show us how you structured your Content section and the code of the XSLT?

     

  • Hari 21 posts 41 karma points
    Sep 20, 2011 @ 07:54
    Hari
    0

    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 "&#x00A0;"> ]>
    <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 &lt;= $maxLevelForSitemap]"
    <li>  
    <href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/></a>  
    <xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1' and @level &lt;= $maxLevelForSitemap]) &gt; 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.

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 20, 2011 @ 08:53
    Fuji Kusaka
    0

    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.

  • rintu rajan 1 post 21 karma points
    Jan 20, 2015 @ 14:27
    rintu rajan
    0

    a

  • Admir 1 post 22 karma points
    Jan 20, 2015 @ 14:57
    Admir
    1

    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

  • Nicola Ayan 7 posts 76 karma points
    Mar 05, 2018 @ 10:45
    Nicola Ayan
    0

    This is how I was able to implement a dynamic sitemap on my Umbraco 7.7.9 installation:

    1. Create a Sitemap document type
    2. Create a Sitemap macro
    3. Create a rule for IIS URL rewriting of the sitemap.xml
    4. Author the Sitemap content page

    Step-by-step tutorial here: https://blog.nicolaayan.com/2018/03/generate-an-umbraco-sitemap/

Please Sign in or register to post replies

Write your reply to:

Draft