Apr 28 2008
Easy Dynamic Google Sitemap with ColdFusion
Have you ever wanted to have your google sitemap updated on the fly based on your postings or other data? This is a simple but effective example:
<CFQUERY name="qFind" datasource="astores">
select * from astores_names
</CFQUERY>
<cfxml variable="mydoc">
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<cfoutput query="qFind">
<url>
<loc>http://www.thewarp.org/blog/store.cfm?site=#store_name#</loc>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
</cfoutput>
</urlset>
</cfxml>
<!--- <cfdump var=#mydoc#> ---><CFCONTENT
TYPE="text/xml"
RESET="yes"><CFOUTPUT>#ToString(mydoc)#</CFOUTPUT>
An example can be seen here:
http://www.thewarp.org/store_xml.cfm

Posts