adcgptr
I'm new here

mapping folder to template

How to map the folder to the template in crownpeak? So that, if we create any page under that folder, it follows the same tamplate

1 Reply
DavidMadacsi
Crownpeak Employee

HI, @adcgptr the best way to have a folder mapped to a template is by using a model. A model lets you specify a template as well as a workflow. Below are two ways to add a model to your folder, the first copies and reuses a default model, the second creates a new model from scratch.

1. We recommend the models being set per site root. Let's use the Asset model in our example. You can find a default model from here - /System/Models/Basis/Asset/Asset  (paste this into the search). Copy and paste the Asset model folder into the model folder for your site directory under Component project/models and rename if desired. Browse to the model folder and the asset within and in properties for the model, modify it as necessary (choose different template or workflow for example) and save. Select your original folder and then in the properties view you can set your new model by browsing to it and saving, thus applying the new template or workflow.

OR

2. Navigate to Component project/models/name. Right click and choose new>Folder and name the folder as desired. Navigate to your new folder. Right click and choose new>file and name this file the same name as the folder, for example. In properties, select the template and workflow you prefer. Select your original folder and then in the properties view you can set your new model by browsing to it, thus applying the new template or workflow.

Now when you create new>file in your folder, choose your model and the properties such as template and workflow will be applied.

 

for more info on Models have a look here

 

 

0 Kudos