Create a MenuManager template called "google_sitemap":
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.90">
{if $count > 0}
{assign var='now' value=$smarty.now|strtotime}
<url>
{foreach from=$nodelist item=node}
<url>
<loc>{$node->url}</loc>
<lastmod>{$node->modified|date_format:'%Y-%m-%dT%T-08:00'}</lastmod>
<changefreq>{assign var='mod' value=$node->modified|strtotime}{math assign='age' equation="(n-m)/86400" n=$smarty.now m=$mod}{if $age < 2}hourly{elseif $age< 14}daily{elseif $age < 30}weekly{else}monthly{/if}</changefreq>
<priority>0.5</priority>
</url>
{/foreach}
{/if}
</urlset>
Code: Select all
{menu template='google_sitemap' show_all=1 collapse=0}
Update your .htaccess file:
Code: Select all
php_flag magic_quotes_gpc Off
php_flag register_globals Off
# Make sure you have Options FollowSymLinks
# and Allow on
#RewriteEngine On
#Rewrites page.shtml as index.php?page
#RewriteRule ^(.+)\.html$ index.php?page=$1
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^sitemap.xml$ index.php?page=sitemap&showtemplate=false [L]
#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Voila! Now http://www.yoursite.com/sitemap.xml will give a Google site map. And you can customize it based on extra page attributes, for example, to set the priorities or to hide classes of pages from the map!