Using the Search Engine Sitemap generator macro
You can create sitemap files by calling the SearchEngineSitemap macro. This macro will generate two or more files in the WWW root of your site. You can render this item on a daily basis e.g. by using the SignalSmartsite tool.
A typical example of the macro looks like this:
Smartsite SXML
Copy Code
<se:impersonate username="john" password="secret">
<se:searchenginesitemap generaterobotstxt="ifnotexists" hostheader="http://localhost/" ping="true" sitemapfilename="mysitemap" usecompression="false" username="guest">
<se:parameters>
<se:parameter name="urls">
<se:includefiles path="/" extensions="htm,html,txt,pdf" recurse="true" />
<se:includeitems channel="def" items="2" recurse="true" includehidden="true" />
<se:includeitems channel="def" contenttypes="wp,pwp,awp" />
<se:excludeitems contenttypes="js,css" />
</se:parameter>
</se:parameters>
</se:searchenginesitemap>
</se:impersonate>
Before discussing the Impersonate macro, we'll discuss the SearchEngineSitemap macro and its parameters.
Parameter | Description |
---|---|
hostheader | The host header describes which host header is used for the links in the generated files. The host header must match one of the host headers defined in one of your channels. Only urls to a single domain can be generated in a sitemap file so if you have e.g. two domain names such as www.mysite.com and www.mysite.nl, you must generate two sitemap files, one for each domain. Note that the channels specified in the parameter urls must be mapped to this host header. |
sitemapfilename | This parameters allows you to choose a different sitemap filename when generating multiple sitemap files for different domains. This filename will be followed by a postfix like "-1.xml" or "-index.xml". |
username | The name of the user that is used to check if files and items are publicly accessible. The default user is the Guest user but can be changed. |
usecompression | Set this parameter to true to generate compressed sitemap files. Compressed files save bandwidth and diskspace but are not human readable. |
ping | Set ping to true to automatically send a request to some of the major search engines, notifying them that there is a new sitemap available. |
generaterobotstxt | The macro will by default generate a robots.txt file if none exists. This robots.txt file will contain a reference to the sitemap file which will help some search engines discover your sitemap. Change this setting to never or always generate a robots.txt file. |
defaultpriority | The default priority set to items and files for which no specific priority has been set. |
urls |
This parameter allows you to specify which items should be included in the sitemap files. The urls parameter can contain four elements:
|
The Impersonate macro is needed when the default guest user has no write access in the WWW root. Under normal circumstances this is the case and since the macro needs to write its sitemap file(s) and index file in the WWW root, it will need to run under the credentials of a user that has the ability to write in the WWW root.