CMS Made Simple Google Sitemap


/ Published in: Apache
Save to your folder(s)

Simple way to generate dynamic sitemap with CMS Made Simple


Copy this code and paste it in your HTML
  1. //Add to HTACCESS
  2. RewriteCond %{REQUEST_FILENAME} !-f [NC]
  3. RewriteCond %{REQUEST_FILENAME} !-d [NC]
  4. RewriteRule ^sitemap.xml$ index.php?page=sitemap&showtemplate=false [L]
  5. RewriteRule ^sitemap.html$ http://www.domain.com/index.php [R=301,L]
  6.  
  7. //CREATE PAGE CALLED SITEMAP AND INSERT THIS SMARTY TAG
  8.  
  9. {menu template='google_sitemap' show_all=1 collapse=0}
  10.  
  11. <?xml version="1.0" encoding="UTF-8"?>
  12. <urlset
  13. xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  14. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  15. xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
  16. http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
  17. {if $count > 0}
  18. {assign var='now' value=$smarty.now|strtotime}
  19. {foreach from=$nodelist item=node}
  20. {if $node->alias !== "sitemap"}
  21. <url>
  22. <loc>{$node->url}</loc>
  23. <lastmod>{$node->modified|date_format:'%Y-%m-%dT%T-08:00'}</lastmod>
  24. <changefreq>daily</changefreq>
  25. <priority>0.5</priority>
  26. </url>
  27. {/if}
  28. {/foreach}
  29. {/if}
  30. </urlset>

URL: http://forum.cmsmadesimple.org/viewtopic.php?f=4&t=39258

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.