[Beginner] Building a Google Sitemap


(Duncan Robertson) #1

This tutorial will teach you how to make a Google sitemap that you can submit to your Google Webmaster Tools. Helping Google crawl your site is a key part of anyone’s search strategy and has proven time and again to help increase Google traffic on our portfolio.


1) Begin by making a new Design file. Call it something like ‘Google Sitemap’. You need to do this to declare the correct sitemap protocol.



Now add the following code the parse file and click save:


    <?xml version="1.0" encoding="UTF-8"?>
    


[b]2) [/b]Now create and Asset Listing page at the highest level (top) of your domain. Google wants to see the .xml extension on your sitemap so make sure that you do that upfront by naming your Asset listing page as ‘sitemap.xml’.

[b]3) [/b]Go to the Details screen on your new asset listing and select which assets to list and where to find them:

[list=1]
  • For ‘Asset Types to List’ select ‘Standard Page’ and whatever other asset times you want discoverable by the Google bot.
    [*]For ‘Asset Locations’ make your root node your containing Site.

    [b]NOTE:[/b] Matrix will seriously battle if you’re listing a huge amount of pages and unfortunately Google won’t wait around for XML to begin loading. If you’re getting sitemap timeout errors split your sitemap up and submit multiple ones to Google.

    [b]3)[/b] Expand your Asset listing in the tree and edit the ‘Page Contents’ screen. Make sure you’ve got only one DIV on that page and [i][b]make sure that it is presenting RAW HTML[/b][/i]. Then add the following code:

        %asset_listing%


    [b]4) [/b]Now edit the ‘Type Formats’ screen. Once again make sure that you have only one DIV on that page and [i][b]make sure it’s presenting RAW HTML[/b][/i]. Then add the following code:

        
        %asset_url%
        %asset_updated_short%
        


    [b]5)[/b] Now apply the ‘Google Sitemap’ design in the Settings screen as the ‘System Defined Frontend Design’ and make the asset listing live.

    [b]6)[/b] Preview the page in any compliant browser, and if there is a problem you’ll be warned. Submit to Google. Have a beer.

  • (Rachel Macdonald) #2

    Exactly what I was looking for! Thank you!


    (Rachel Macdonald) #3

    I am having a lot of trouble getting this to validate. I think all the divs inserted by the asset list are the problem. My sitemap ends up looking like this:


    <div id="content_div_7377">

    <url>

    <loc>http://www.site.com.au/1</loc>



    <lastmod>2008-05-23</lastmod>

    </url>

    </div>



    <div id="content_div_7377">

    <url>

    <loc>http://www.site.com.au/2</loc>

    <lastmod>2008-06-25</lastmod>

    </url>

    </div>



    <div id="content_div_7377">

    <url>

    <loc>http://www.site.com.au/3</loc>



    <lastmod>2008-04-24</lastmod>

    </url>

    </div>



    I set my format and page contents to raw html… how do I stop all those divs appearing?


    (Greg Sherwood) #4

    You need to open div properties and set the display format from BLOCK LEVEL to RAW HTML.


    (Rachel Macdonald) #5

    Whoops, much better, thanks!


    (P Madley) #6

    Hi folks, sorry to resurrect this but it solved our problem (thanks). Did anybody have any problem getting it to display data source assets? We can only get a few listed, but there's no logical reason for this; nothing makes those special compared to the couple of hundred other data sources.


    Hrm…


    (Jenny Pallett) #7

    I realise this is a very old thread but is this still a valid way of getting a sitemap.xml file?


    #8

    I followed through these instructions twice and keep getting this error when viewing the sitemap.xml page in browser:

    “error on line 15 at column 179: Opening and ending tag mismatch: img line 0 and a”

    Anyone know what might be the issue?


    #9

    I ended up removing the line:

    <MySource_PRINT id_name="__global__" var="content_type" content_type="text/xml" />
    

    and it works.