Problem with sitemaps

  • Hi SPQRInc I've installed the latest sitemap on on this test version of Pagekit. But unfortunately I can’t get it to work. It outputs the following only:


    XML
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <!-- Created with SPQR Sitemap Generator 2.0 https://spqr.wtf --><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4. xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
    5. http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
    6. <url>
    7. <loc>http://web.site/</loc>
    8. <changefreq>weekly</changefreq>
    9. <priority>0.5</priority>
    10. </url>


    The backend says okay wait while processing in a notification, I then see a ‘blank’ notification but the above output is all I receive.


    I see there is a debug mode but can’t find the output for this.


    I appreciate you aren’t supporting PageKit anymore due to the lack of development of PageKit itself but would appreciate some help if possible.


    Thanks


    Ade



    EDIT: I'm seeing the following error in inspector:


    Code
    1. Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    2. http://web.site/admin/sitemap/generate
  • Thanks, I enabled both the PageKit debug and the one for SiteMap. Web Inspected shows the same error but with the following errors in console (I don't think they are related):


  • Ok I'm seeing the following error:


  • I just installed/enabled sitemap-generator on a new site, and made some modifications to the extension so that it would use a stylesheet instead of the raw XML. In making the changes I ran across something similar that it was causing mal-formed xml errors, and I ended up diagnosing the cause.


    The following is what I ended up with as the modification made to the /packages/spqr/sitemap/src/Helper/SitemapHelper.php file, and it's working as it should be in my case - with pagekit v1.0.16 on PHP 7.2.8 - to generate a proper map (with a stylesheet I adapted) here: https://for-sale.lumiworx.com/sitemap.xml


    The code I changed is under the public function generate() function, at line 139...




    I'm not sure if this will fix your exact issue, as I was debugging for something different, but if you do try the code above, you can either remove the line to call the stylesheet, or I could post it here to use it if you'd prefer to have one. I intended to add in images support at some point too, but you can leave that section in, since it will only load the reference - that exists - instead of a stylesheet, that doesn't exist (yet).

  • Thanks for the help but in my case it doesn’t seem to have fixed the issues. I can see the newly generated sitemap with your style sheet reference but nothing else.


    Do you be the ‘Sitemap Generated’? I just get an empty notification.

  • Sorry for the late reply. I wasn't getting notifications from the topic....


    Yes, I get everything, as expected. Here's a screen grab with the notifications. The admin backend may be quite different looking, but it's just a heavily modified admin.css. :)


    [Blocked Image: https://testbed.lumiworx.com/u…368b04f67957f8889f37b.png]


    When trying to diagnose my earlier issue, I used FireFox's developer tools to go through all the console and other errors I was getting with the scripts, as well as using 'view page source' on the sitemap.xml file itself to visually see the mal-formed lines. I typed in the URL manually to access it in the browser.


    Is there a sitemap file showing up in your root folder that you can open to read the contents? if the file isn't being generated at all, then it might be a permissions problem with your site's directories, or your host may have restricted something to keep the file from being saved.