Directory Variables
Directory variables modify the content inside a folder to change the behavior or display of files within a section. For example, set a directory variable to choose varying color schemes for different sections of your site that use the same template, like departments.
Set directory variables for your site and folder(s) by assigning a variable name and a variable value.
Set directory variables for your site, as follows:
- Navigate to Setup > Sites.
- Click the More Actions menu for your site.
- Click Edit > Site Access.
- In the Site Access Settings box, locate Directory Variables and click +Add.
- Click the Create New Variable dropdown to select a system variable or enter text to name a custom variable.
- To complete a custom variable, declare the variable in the folder's TMPL or XSL file.
- In the Value field, enter the appropriate input.
- Click Save.
Set directory variables for a folder, as follows:
- Navigate to Content > Pages and find the folder to associate with a directory variable.
- Click More Actions.
- Click Edit > Access.
- In the Access Settings box, locate Directory Variables and click +Add.
- Click the Create New Variable dropdown to select a system variable or enter text to name a custom variable.
- To complete a custom variable, declare the variable in the TMPL or XSL for the folder.
- In the Value field, enter the appropriate input.
- ClickSave.
Directory variables are applied recursively, so editing a directory variable for /academics
, for example, applies that variable to any subfolders of /academics
.
A folder inherits directory variables from its parent folder(s). Inherited variables can't be edited, but they can be overwritten. To overwrite an inherited variable, from the Access Settings box add the same variable name and enter a different value.
Typically, directory variables are custom-made for each institution and their functionality may differ by implementation. Five directory variables are included with every installation of Modern Campus CMS, as follows:
Default Image Folder |
Path to the image folder, no trailing slash (for example You can use the following types of paths:
| When users are inserting an image, they start in the specified folder by default when choosing the image. |
Default Media Folder |
Path to the media folder, no trailing slash (for example You can use the following types of paths:
| When users are inserting a video or other media, they start in the specified folder by default when choosing the media. |
Publish | Add skip: and make a comma-separated list of file extensions (for example skip:xml,xsl,tcf,tmpl ) | Excludes any files with the the defined file extensions from being published when the folder containing them is published. |
Ounav Levels |
Add a number between 2 and 6 to allow navigation hierarchy, as follows: level 1 (default) | Create up to five levels of subnavigation, or nested navigation, to link to pages above or below the current item. |
Ounav Output |
Add the text "li" or Add the text "json" | Set your navigation to output using either <li> elements or JSON format. |
Adjust these directory variables from the Access Settings box, no source code editing required.