How do I configure CFWheels to display the following XML at http://mydomain.com/sitemap.xml?
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<-- I'll add the <url> tags dynamically here later -->
</urlset>
I've removed the "sitemap.xml" from the web.config
file.
After this I'm not sure what to do about creating the controller
and view
. Should I create a "sitemap.xml" folder in the "views" folder, then add an "index.cfm" file and then add the XML above?
Should I create a "sitemap.xml.cfc" file in the "controllers" folder? And what should the controller file contain?
Should it look something like this?
<cfcomponent extends="Controller" output="false">
<cfscript>
function init(){
// Let CFWheels know what type of output this controller can 'provide'
provides("xml");
}
function index(){
}
</cfscript>
</cfcomponent>
Do I need to add an entry to the routes.cfm?