wilr / silverstripe-googlesitemaps

Google Sitemaps module for the SilverStripe CMS
BSD 3-Clause "New" or "Revised" License
74 stars 95 forks source link

xsl issue with version 2.0.1 on SS4.1 #145

Closed guyvanbael closed 6 years ago

guyvanbael commented 6 years ago

Nothing is loading...

schermafbeelding 2018-03-20 om 14 42 40
wilr commented 6 years ago

Tried 2.1.1? Make sure you flush.

guyvanbael commented 6 years ago

tried 2.1.1, flushed.... same issue

schermafbeelding 2018-03-21 om 08 01 08
guyvanbael commented 6 years ago

@wilr fixed it on slack with Andrew... Edit GoogleSitemapController.php like this

    public function styleSheetIndex()
    {
        $html = $this->renderWith('xml-sitemapindex');
        $this->getResponse()->addHeader('Content-Type', 'text/xsl; charset="utf-8"');
        return $html;
    }

    public function styleSheet()
    {
        $html = $this->renderWith('xml-sitemap');
        $this->getResponse()->addHeader('Content-Type', 'text/xsl; charset="utf-8"');
        return $html;
    }

and as for the stylesheetpath use <link rel="stylesheet" href="$resourceURL('wilr/silverstripe-googlesitemaps:css/style.css')" />

wilr commented 6 years ago

Interesting, didn't have any issues on our PHP7 servers around the content type but better to be explicit! so I've added header and tagged a 2.1.2

guyvanbael commented 6 years ago

2.1.2 is now fully SS4.1 compatible. Thanks for your coöperation @wilr