MENU

How to use SitemapMgr

  Previous article Next article  

The SitemapMgr module creates page and module sitemap, robots.txt and humans.txt files.
Ready to use templates for several modules included in the Design Manager like News, CGBlog, Products, etc.

  How to use

1. After installation you will find the SitemapMgr module in the Site Admin menu.

2. The install process will automatically create:

  • www.website.com/robots.txt
  • www.website.com/sitemap.xml
  • www.website.com/assets/sitemaps/sitemap-pages.xml

Pre-existing humans.txt and robots.txt files are not overwritten, but the content is re-used in the module!

3. The humans.txt file is only created after you update the content and save it... If you don't want to use this feature after all, just empty the content and save... The file will be deleted.

4. By default there is a sitemap file created for content pages. In the tab "Sitemaps" you can create more sitemaps.

5. An internal cron job will recreate the sitemaps every 24 hour.

6. In the website root you will find the sitemap index file ( website.com/sitemap.xml ). It is a sitemap for sitemaps. Submit *only* this file to Bing, Google, or... No need to submit all individual sitemaps!

Permissive Smarty
In order to calculate the change frequenty the SitemapMgr module uses a PHP function within Smarty.
You need to add the following line to your config.php file to let it work!

   $config['permissive_smarty'] = 1;

If not you get the error message: "PHP function xxx not allowed by security setting"


 Know issues and fixes

Protocol less URIs

By default CMS Made Simple 2.2 generates so called protocol less URIs. These are without http or https. The reason is to prevent mixed content with SSL-secured websites.

But in sitemaps they should be added...

Simple fix, add to your website's config.php file:

$config['root_url'] = 'http://www.website.com';

or:

$config['root_url'] = 'https://www.website.com';

And afterwards regenerate your sitemaps!


 Additional sitemap templates

CGCalendar module

Module tag for CGCalendar module:

{CGCalendar display='upcominglist' listtemplate='cms_template:Sitemap CGCalendar'}

Uploads module

Create a new summary template in the Uploads module Admin page, named "Sitemap Uploads" and copy-paste this content:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{foreach from=$items item=entry}
<url>
  <loc>{$entry->detailurl}</loc>
</url>
{/foreach}
</urlset>

Module tag for Uploads module:

{Uploads summarytemplate='Sitemap Uploads' count=1000}

  Working example




  Comment Form

Click here to open the form


  30 Comments

CMS Made Simple - Tutorials, tips and tricks - CMSMS

How to use SitemapMgr

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.8
  Last updated: 23-06-2018
  Comments: 30
  http://cms.ms/3xZK

Advertisement



Ads help me to help you! Thanks!

Ads help me to help you! Thanks!

Ads help me to help you! Thanks!