Skip to content

Instantly share code, notes, and snippets.

@modius
Created September 15, 2010 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save modius/580395 to your computer and use it in GitHub Desktop.
Save modius/580395 to your computer and use it in GitHub Desktop.
<cfsetting enablecfoutputonly="true" />
<!--- @@displayname: Google News Sitemap --->
<!--- @@description: Generates a Google News Sitemap from dmNews content items. --->
<!--- @@cacheStatus: 1 --->
<!--- @@cacheTimeout: 60 --->
<!--- @@fuAlias: sitemap --->
<!---
// build sitemap xml
--------------------------------------------------------------------------------------------------->
<cfset oSiteMap=createObject('component', 'farcry.core.packages.googleSiteMap.sitemap').init()>
<cfset stSiteConfig=structNew()>
<cfset stSiteConfig.domainName="#cgi.server_name#">
<cfset stSiteConfig.newspublication="#application.fapi.getConfig('general','sitetitle', '#application.applicationname#')#">
<cfset xml=oSiteMap.generate(stSiteConfig=stSiteConfig,siteMapType="newsSiteMap",newsTypes="dmNews:publishDate")>
<!---
// view
--------------------------------------------------------------------------------------------------->
<CFHEADER NAME="content-disposition" VALUE="inline; filename=dmnews.#now()#">
<cfheader name="Content-Type" value="text/xml">
<cfoutput>#xml#</cfoutput>
<cfsetting enablecfoutputonly="false" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment