Google Sitemaps in FarCry CMS

Whilst its been possible to generate Google sitemaps using an extension for many years, FarCry 6.x introduces a Google Sitemap Service that lets you dynamically create a variety of Google Sitemaps with just a few lines of code.

Your classic Google Sitemap should encapsulate all the navigation points in your information hierarchy -- in FarCry terminology this is your "site overview" tree; the service that builds all your menu structures and related content. To do this we need to generate an extract of all the Navigation Folders (aka dmNavigation content type) to a certain depth and place it in a view that can be reached by Google's indexing engine.

Anything that is essentially a list of content items of a certain type should be built as a "type webskin" (aka listing view) of the principle content type.  In this example, where focused on the dmNavigation content type that is the backbone of the site overview tree.

Create a webskin called:
./yourproject/webskins/dmNavigation/displayTypeSiteMap.cfm

https://gist.github.com/580391

You then point Google to this url e.g http://www.mysite.com/dmNavigation/sitemap. Notice the @@fuAlias: sitemap in the code above, this allows you to use 'sitemap' in the url instead of the full name of the view (ie. displayTypeSiteMap).

For more information see the Google Sitemap Code By Example section of the WIKI.

6847 views and 0 responses