...
Code Block |
---|
title | ./webskins/dmNavigation/displayTypeSiteMap.cfm |
---|
|
<cfsetting enablecfoutputonly="true" />
<!--- @@displayname: Google Sitemap --->
<!--- @@description: Generates a Google Sitemap for all Navigation 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 xml=oSiteMap.generate(stSiteConfig=stSiteConfig,siteMapType="siteMap", types="dmNavigation")>
<!---
// view
--------------------------------------------------------------------------------------------------->
<CFHEADER NAME="content-disposition" VALUE="inline; filename=#urldmnavigation.type#.#now()#">
<cfheader name="Content-Type" value="text/xml">
<cfoutput>#xml#</cfoutput>
<cfsetting enablecfoutputonly="false" />
|
Tip |
---|
title | Multiple Content Types |
---|
|
In the types argument passed to the oSiteMap object you have a list of types. The sitemap generator will then add all of those type into the sitemap. |
...
Code Block |
---|
title | For example, ./webskins/dmNews/displayTypeSiteMap.cfm |
---|
|
<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=#urldmnews.type#.#now()#">
<cfheader name="Content-Type" value="text/xml">
<cfoutput>#xml#</cfoutput>
<cfsetting enablecfoutputonly="false" />
|
In the newsTypes argument passed to the oSiteMap you can pass in a list of types but you must also pass in the name of the property for publishdate.
...