You are either using the original sitemap template suggested by @KK in this thread, or have your own custom sitemap. If you are using the sitemap template provided by KK, you have probably noticed that you have to add in a lot of manual entries for things such as a list-view URL on a cloned template.
Today I am attaching something I have created that will hopefully alleviate some of the time consuming parts of managing a sitemap in couch.
this single template will allow you to manage both cloned and single page templates from the sitemap page in the admin panel. You will have the power to select whether a cloned template outputs URLs for its posts, for its folder URLs, for the template list view. All separately of course, allowing full control over every single template added.
The sitemap will automatically exclude all non-executable templates (often used to define regions for other templates), every other type of page or template can be excluded from the admin panel page.
Furthermore, you can exclude individual posts by adding a list of comma separated post IDs to the text field allowing you full control via the admin panel for your websites sitemap.
Note: Please let me know if there are any issues with nested templates, I have only done limited testing in that area.
Installation instructions:
Place both files into the root of your website, open sitemap.php in your favourite texteditor and edit the first line
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
to make sure it points to your couch install directory, just like any other template on your site.
If you wish to remove the sitemap stylesheet, please change line 2. From:
- Code: Select all
<cms:content_type 'text/xml' /><cms:concat '<' '?xml version="1.0" encoding="' k_site_charset '"?' '>' /><cms:concat '<' '?xml-stylesheet type="text/xsl" href="' k_site_link 'main-sitemap.xsl"?' '>' />
To:
- Code: Select all
<cms:content_type 'text/xml' /><cms:concat '<' '?xml version="1.0" encoding="' k_site_charset '"?' '>' />
and delete the 'main-sitemap.xsl' as it will not be needed.
You may also re-style the sitemap to whatever you see fit. The provided stylesheet is what I use for my sites, it is not a requirement to have a stylesheet for a sitemap, it adds nothing but making the sitemap easier to read for you as a developer.
I hope everyone finds this template as useful as I have!