Sitemap for List output

  • Thanks Drew. So I have the following:

    then I have the two template files:

    First the sitemap.html

    Code
    1. <perch:before><?xml version="1.0" encoding="UTF-8"?>
    2. <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    3. </perch:before>
    4. <url>
    5. <loc>https://www.hellohighstreet.com<perch:pages id="pagePath" /></loc>
    6. </url>
    7. <perch:after>
    8. </urlset>
    9. </perch:after>

    And second the custom one:


    Code
    1. <perch:before><?xml version="1.0" encoding="UTF-8"?>
    2. <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    3. </perch:before>
    4. <url>
    5. <loc>https://www.hellohighstreet.com/listing-details?s=<perch:content id="slug"/></loc>
    6. </url>
    7. <perch:after>
    8. </urlset>
    9. </perch:after>

    The first works fine but it would appear that nothing is coming out for the custom one?

  • Thanks Ellimondo, so I now have this working - I did as you said with the headers so the first sitemap.html has the opening tags - then the sitemap.php page has the closing tags. I also noticed that I had not included the page ref for the custom output and now that is in there it is outputting the listings so thats great.


    So all appears to work except debugging gives me the following:



    Code
    1. Array
    2. ( [type] => 2 [message] => Cannot modify header information - headers already sent by (output started at ../sitemap.php:2) [file] => ../perch/core/lib/PerchUtil.class.php [line] => 1415
    3. )


    All seems to work anyway but would be good to know for future what that error means?



    EDIT: It would appear this was caused by a whitespace above the php call in the sitemap page

    Edited once, last by awrench1: Solution found -edited with answer for future reference ().