Forum
detail.php portfolio items in the sitemap?
I have a lot of portfolio items which I have set up and work great, to show in the sitemap, but they dont with my current setup.
My portoflio items are configured through a details.php page, just like in the 'Perch portfolio items with categories tutorial'.
Here is my sitemap.
<?php
header('Content-type: application/xml');
include('perch/runtime.php');
echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">';
// site pages
perch_pages_navigation(array(
'template' => 'sitemap.html',
'flat' => false,
'hide-extensions' => true
));
// blog posts
perch_blog_custom(array(
'template' => 'sitemap.html',
'paging' => false,
'count' => 9999,
'sort-order' => 'ASC'
));
echo '</urlset>';
You can add them in the same what you display a listing in your portfolio section - just like you've already done with Blog.
I got it working!
I made a 'portfolio_sitemap.html' template in the standard templates/content folder.
Then included this in my sitemap.php like so