• Document Up to Date

Site Configuration

The site configuration file contains the primary configuration for Crafter Studio’s behavior. Each site has its own site configuration file that controls its behavior independently of other sites.

To modify the site configuration, click on siteConfig from the bottom of the Sidebar, then click on Configuration and select Site Configuration from the dropdown list.

Configurations - Open Site Configuration

Sample

CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/site-config.xml
  1<?xml version="1.0" encoding="UTF-8"?>
  2<site-config>
  3  <version>7</version>
  4  <wem-project>mysite</wem-project>
  5  <display-name>mysite</display-name>
  6  <default-timezone>EST5EDT</default-timezone>
  7
  8  <!-- Site URLs. Default to http://localhost:8080 if blank -->
  9  <site-urls>
 10    <authoring-url></authoring-url>
 11    <staging-url></staging-url>
 12    <live-url></live-url>
 13  </site-urls>
 14
 15  <published-repository>
 16    <enable-staging-environment>false</enable-staging-environment>
 17  </published-repository>
 18
 19  <publishing>
 20    <comments>
 21      <!-- Global setting would apply to all -->
 22      <required>false</required>
 23      <!-- Additional (also optional) specific overrides -->
 24      <!-- <delete-required/> -->
 25      <!-- <bulk-publish-required/> -->
 26      <!-- <publish-by-commit-required/> -->
 27    </comments>
 28  </publishing>
 29
 30  <form-engine>
 31    <field-name-postfix>true</field-name-postfix>
 32    <ignore-postfix-fields>
 33      <field>internal-name</field>
 34      <field>file-name</field>
 35      <field>placeInNav</field>
 36      <field>scripts</field>
 37      <field>mime-type</field>
 38      <field>force-https</field>
 39      <field>navLabel</field>
 40      <field>expired</field>
 41      <field>key</field>
 42      <field>value</field>
 43      <field>items</field>
 44      <field>redirect-url</field>
 45      <field>authorizedRoles</field>
 46      <field>role</field>
 47      <field>disabled</field>
 48    </ignore-postfix-fields>
 49  </form-engine>
 50
 51  <!--
 52  Pattern that Studio will use to load plugin from the site repository
 53  Required placeholders: ${type}, ${name}
 54  -->
 55  <plugin-folder-pattern>/config/studio/plugins/${type}/${name}</plugin-folder-pattern>
 56
 57  <repository rootPrefix="/site">
 58
 59    <!-- default inheritance file name -->
 60    <level-descriptor>crafter-level-descriptor.level.xml</level-descriptor>
 61
 62    <!-- The section below classifies items into folders for two dashboard widgets:
 63    - Items Waiting For Approval
 64    - Approved Scheduled Items
 65
 66    Items that match the paths specified will be grouped together in the dashboard widget
 67    -->
 68    <folders>
 69      <folder name="Pages" path="/website" read-direct-children="false" attach-root-prefix="true"/>
 70      <folder name="Components" path="/components" read-direct-children="false" attach-root-prefix="true"/>
 71      <folder name="Assets" path="/static-assets" read-direct-children="false" attach-root-prefix="false"/>
 72      <folder name="Templates" path="/templates" read-direct-children="false" attach-root-prefix="false"/>
 73    </folders>
 74
 75    <!-- Item Patterns -->
 76    <patterns>
 77      <!-- The section below helps determine the type of content based on regex. This shows up in two places:
 78      - The activity audit log.
 79      - The UI icon used for the item
 80      -->
 81
 82      <pattern-group name="page">
 83        <pattern>/site/website/([^&lt;]+)\.xml</pattern>
 84      </pattern-group>
 85
 86      <pattern-group name="component">
 87        <pattern>/site/components/([^&lt;]+)\.xml</pattern>
 88        <pattern>/site/system/page-components/([^&lt;]+)\.xml</pattern>
 89        <pattern>/site/component-bindings/([^&lt;]+)\.xml</pattern>
 90        <pattern>/site/indexes/([^&lt;]+)\.xml</pattern>
 91        <pattern>/site/resources/([^&lt;]+)\.xml</pattern>
 92      </pattern-group>
 93
 94      <pattern-group name="asset">
 95        <pattern>/static-assets/([^&lt;"'\)]+)</pattern>
 96      </pattern-group>
 97
 98      <pattern-group name="rendering-template">
 99        <pattern>/templates/([^&lt;"]+)\.ftl</pattern>
100      </pattern-group>
101
102      <pattern-group name="scripts">
103        <pattern>/scripts/([^&lt;"]+)\.groovy</pattern>
104      </pattern-group>
105
106      <!-- The section below enumerates the mime-types we can preview -->
107      <pattern-group name="previewable-mimetypes">
108        <pattern>image/(.*)</pattern>
109        <pattern>application/pdf</pattern>
110        <pattern>video/(.*)</pattern>
111        <pattern>application/msword</pattern>
112        <pattern>application/vnd.openxmlformats-officedocument.wordprocessingml.document</pattern>
113        <pattern>application/vnd.ms-excel</pattern>
114        <pattern>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</pattern>
115        <pattern>application/vnd.ms-powerpoint</pattern>
116      </pattern-group>
117    </patterns>
118
119    <!-- The patterns below identify what is allowed to show up in the Dashboard widgets -->
120    <display-in-widget-patterns>
121        <display-in-widget-pattern>.*</display-in-widget-pattern>
122    </display-in-widget-patterns>
123  </repository>
124  <contentMonitoring>
125    <monitor>
126      <name>Content Expiring Tomorrow</name>
127      <query>expired_dt:[now+1d/d TO now+2d/d]</query>
128      <paths>
129        <path>
130          <name>All Site</name>
131          <pattern>/site/.*</pattern>
132          <emailTemplate>contentExpiringSoon</emailTemplate>
133          <emails>admin@example.com</emails>
134          <locale>en</locale>
135        </path>
136      </paths>
137    </monitor>
138    <monitor>
139      <name>Content Expiring In One Week</name>
140      <query>expired_dt:[now+7d/d TO now+8d/d]</query>
141      <paths>
142        <path>
143          <name>All Site</name>
144          <pattern>/site/.*</pattern>
145          <emailTemplate>contentExpiringSoon</emailTemplate>
146          <emails>admin@example.com</emails>
147          <locale>en</locale>
148        </path>
149      </paths>
150    </monitor>
151    <monitor>
152      <name>Content Expiring In One Month</name>
153      <query>expired_dt:[now+30d/d TO now+32d/d]</query>
154      <paths>
155        <path>
156          <name>All Site</name>
157          <pattern>/site/.*</pattern>
158          <emailTemplate>contentExpiringSoon</emailTemplate>
159          <emails>admin@example.com</emails>
160          <locale>en</locale>
161        </path>
162      </paths>
163    </monitor>
164    <monitor>
165      <name>Content Expiring In Two Months</name>
166      <query>expired_dt:[now+60d/d TO now+62d/d]</query>
167      <paths>
168        <path>
169          <name>All Site</name>
170          <pattern>/site/.*</pattern>
171          <emailTemplate>contentExpiringSoon</emailTemplate>
172          <emails>admin@example.com</emails>
173          <locale>en</locale>
174        </path>
175      </paths>
176    </monitor>
177  </contentMonitoring>
178</site-config>