Control Which Document Types Can Be Created in a Folder
Overview
You can restrict which document types users can create within a specific folder in Bloomreach Content. This allows you to guide content authors and enforce consistent content structures.
When to Use
Restrict allowed document types in a folder to:
- Reduce the number of choices for authors, making content creation more straightforward.
- Ensure all documents in a folder (and its subfolders) share the same type, which simplifies delivery tier implementation—especially when using wildcard sitemap items such as
/products/**.html.
How It Works
The set of document types available in a folder is determined by a query. By default, all document types are available. You can override this behavior by configuring a custom query for a folder, limiting which document types can be created there.
This page covers two main approaches:
- Restricting Document Types for Out-of-the-Box Features
- Manual Configuration for Custom Document Types
You can also add a custom icon for menu items.
| Before | After |
| --- | --- |
![]() | ![]() |
![]() | ![]() |
Using Document Types Included with Out-of-the-Box Features
When you add out-of-the-box features such as News or Events, the folders created by these features are typically pre-configured to allow only the relevant document type.
You can create additional folders and configure their document type restrictions through the CMS user interface.
Example: Restricting a Folder to "News" Documents
Assume your project includes the "News" feature and you have created a "press releases" folder. You want to restrict this folder so that only "news" documents can be created inside it.
-
In the Content application, navigate to the "press releases" folder.
-
Right-click the folder and select
Edit allowed content...from the context menu.
-
The folder will show the default queries (
Add new translated folderandAdd new document). Remove both by clicking theXicon in theActionscolumn.
-
At the bottom of the dialog, select
Add new news folderandAdd new news itemfrom the dropdown.
-
The folder is now configured to allow only "news" documents and "news folders" (which applies the same restriction to subfolders).

-
Click
OKto save the changes.
The context menu for the "press releases" folder now only shows options to add a news folder or news item:

Manual Configuration for Custom Document Types
If your project uses custom document types (not provided by out-of-the-box features), you need to define template queries for those types before you can restrict folder content.
You can generate template queries for custom document types using the Template Query Generator (part of the Essentials development tools). Alternatively, you can configure template queries manually in the Console.
Example: Restricting a Folder to a Custom Document Type
Goal: Restrict the folder /content/documents/myproject/products so that only documents of type myproject:product can be created.
1. Create a Template Query for the Product Document Type
-
In the console, copy the node:
/hippo:configuration/hippo:queries/hippo:templates/new-documentto:
/hippo:configuration/hippo:queries/hippo:templates/new-product -
Update the query to allow only the
myproject:productdocument type:/hippo:configuration/hippo:queries/hippo:templates/new-product: jcr:statement: //element(*,hipposysedit:namespacefolder) /element(*,mix:referenceable) /element(*,hipposysedit:templatetype) /hipposysedit:prototypes /element(hipposysedit:prototype,myproject:product)Only the last part of the JCR statement changes from
hippo:documenttomyproject:product. -
Update the i18n label:
/hippo:configuration/hippo:translations/hippo:templates/en: new-product: new product -
Save your changes.
2. Create a Template Query for Subfolders
To ensure child folders also restrict document types to myproject:product, configure a query for subfolders.
-
Copy the node:
/hippo:configuration/hippo:queries/hippo:templates/new-translated-folderto:
/hippo:configuration/hippo:queries/hippo:templates/new-product-folder -
Update the JCR statement for creating child folders:
/hippo:configuration/hippo:queries/hippo:templates/new-product-folder: jcr:statement: /jcr:root/hippo:configuration/hippo:queries/hippo:templates /new-product-folder/hippostd:templates/node()Change
new-translated-foldertonew-product-folder. -
Set the available queries for new product folders:
/hippo:configuration/hippo:queries/hippo:templates/new-product-folder/hippostd:templates/hippostd:folder: hippostd:foldertype: [new-product-folder, new-product]These values correspond to the JCR node names of the queries you created.
-
Update the i18n label:
/hippo:configuration/hippo:translations/hippo:templates/en: new-product-folder: new product folder -
Save your changes.
3. Configure the Folder to Use the New Queries
Note: This step is performed in the CMS UI and follows the same process as for out-of-the-box document types.
- In the Content application, select the
myproject > productsfolder. - Open the context menu and select
Edit allowed content. - Remove any existing options.
- Add
Add new product folder... (new-product-folder)andAdd new product... (new-product)from the dropdown. - Click
OKto save. - The context menu for the "products" folder now includes only the options to add a new product folder or a new product.
Use a Custom Icon
By default, menu items use a folder icon if the query name ends with "folder" (for example, new-product-folder), or a document icon otherwise.
To use a custom icon for a menu item, add an SVG icon (16x16 pixels) to the following directory in your project:
cms/src/main/resources/org/hippoecm/frontend/plugins/standardworkflow
Name the icon file after the query name, with -tiny appended. For example, for the query new-product, use:
cms/src/main/resources/org/hippoecm/frontend/plugins/standardworkflow/new-product-tiny.svg
After rebuilding and restarting the application, the menu item will display the custom icon.
Note: For backward compatibility, you can use a 16x16 PNG icon (for example,
new-product-16.png), but SVG icons are recommended for better appearance.
Limitations
Document type restrictions apply only when creating new documents in a folder. They do not prevent users from copying documents of other types into the folder from elsewhere.



