Configuration

Landscape core settings are defined into web/app.config

Setting name Default Value Explanation
landscapeConfigFileVirtualPath ~/landscape.xml The virtual path to the xml configuration file
landscapeEnableCaching false

Whether to use asp.net caching.

When working in non-hosted environments, the cache will not be available

landscapeOutputDocTypePublic "-//W3C XHTML 1.0 Transitional//EN" Public DOCTYPE applied to template transformation results
landscapeOutputDocTypeSystem "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" System DOCTYPE applied to template transformation results
landscapeOutputIndent false Whether to indent XML output
landscapeXslExtension .xslt

The file extension to use for XSLT files.

Note that the extension is ASP.NET style, with trailing slash.

Once Landscape is loaded, it reads its sources from the settings defined in the configuration file. Multiple lookup sources can be specified for each landscape component.

Here is a basic configuration file:

<?xml version="1.0" encoding="utf-8" ?>
<landscape xmlns="urn:landscape-config">
  <templates>
    <add path="/Templates" priority="2"/>
    <add path="/InternalTemplates" priority="1"/>
  </templates>
  <includes>
    <add path="/InternalTemplates/Includes" priority="2"/>
    <add path="/Templates/Includes" priority="1"/>
  </includes>
  <widgets>
    <add path="/InternalTemplates/Widgets" priority="1"/>
    <add path="/Templates/Widgets" priority="2"/>
  </widgets>
  <controls>
    <add priority="1" virtualpath="~/UserControls"/>
  </controls>
  <extensions>
    <add alias="urn:myXsltExtension" assembly="MyAssembly" type="Namespace.To.My.Extension.Class"/>
  </extensions>
</landscape>

Basically here we defined the folders that are search by Landscape to find templates, includes and widgets.

Also, any custom XSLT extension can be attached to the XSL compiler just by creating the corresponding <add/> node into the <extensions/> section.

Remember that the assembly name MUST BE EXTENSIONLESS

Last edited Oct 31, 2011 at 12:01 AM by Kunyo, version 7

Comments

No comments yet.