Jump to:

10843 Posts in 2514 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Google Sitemaps Module Parsing Error

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 482 Views
  • airscool
    Avatar
    Community Member
    2 Posts

    Google Sitemaps Module Parsing Error Link to this post

    I have downloaded the latest version of the Google Sitemaps Module and uploaded the unpacked folder (named googlesitemaps) into the www folder.

    I have then created a new folder under mysite called _config into which I have placed a file googlesitemaps.yml with the following content:

    ---
    Name: customgooglesitemaps
    After: googlesitemaps
    ---
    GoogleSitemap:
    enabled: true
    objects_per_sitemap: 1000
    google_notification_enabled: true
    use_show_in_search: true

    I have succesfully run /dev/build and rebuilt the database but upon visiting www.mysite.co.uk/sitemap.xml I get the following error:

    XML Parsing Error: mismatched tag. Expected: </base>.
    Location: http://www.mysite.co.uk/sitemap.xml
    Line Number 11, Column 3:

    </head>
    --^

    Am I missing something?

    Addition: I have since attempted to run /dev/build and I now get the following error:

    Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unable to parse line 1 (---).' in /home/ardenhou/public_html/framework/thirdparty/zend_translate_railsyaml/library/Translate/Adapter/thirdparty/sfYaml/lib/sfYamlParser.php:265 Stack trace: #0 /home/ardenhou/public_html/framework/core/manifest/ConfigManifest.php(211): sfYamlParser->parse('???---?Name: cu...') #1 [internal function]: SS_ConfigManifest->addYAMLConfigFile('googlesitemaps....', '/home/ardenhou/...', 2) #2 /home/ardenhou/public_html/framework/filesystem/FileFinder.php(158): call_user_func(Array, 'googlesitemaps....', '/home/ardenhou/...', 2) #3 /home/ardenhou/public_html/framework/core/manifest/ConfigManifest.php(141): SS_FileFinder->find('/home/ardenhou/...') #4 /home/ardenhou/public_html/framework/core/manifest/ConfigManifest.php(75): SS_ConfigManifest->regenerate(false) #5 /home/ardenhou/public_html/framework/core/Core.php(275): SS_ConfigManifest->__construct('/home/ardenhou/...', false, true) #6 /home/ardenhou/public_html/framework/ in /home/ardenhou/public_html/framework/thirdparty/zend_translate_railsyaml/library/Translate/Adapter/thirdparty/sfYaml/lib/sfYamlParser.php on line 265

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: Google Sitemaps Module Parsing Error Link to this post

    Hello,

    The dev/build error you are getting is a result of malformed yml code. It must be properly indented so instead of :

    Name: customgooglesitemaps
    After: googlesitemaps
    ---
    GoogleSitemap:
    enabled: true
    objects_per_sitemap: 1000
    google_notification_enabled: true
    use_show_in_search: true


    It should be:

    Name: customgooglesitemaps
    After: googlesitemaps
    ---
    GoogleSitemap:
    <space><space>enabled: true
    <space><space>objects_per_sitemap: 1000
    <space><space>google_notification_enabled: true
    <space><space>use_show_in_search: true

    Intents for yml must be 2 spaces. ( here shown as <space><space> since the post strips out the spaces if I put them in.

    As far as the missing </base> tag, I am not sure how to fix that as even if I manually put the base tag into my page.ss file so that is has a nice closing tag it does not when rendered by Firefox.

    I don't know why firefox does not properly close the <base> or <meta>tags but the xml parser expects closing tags at least on the <base> tag.

    I am hoping that the maintainers of the googlesitemaps module can find a solution. One such solution would be to have the controller render the sitemap.xml with a custom template that we could format properly for the sitemap but not affect the rest of the site.

    482 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.