close

Filter

loading table of contents...

Studio Developer Manual / Version 2310

Table Of Contents

9.34.1 Default Folders

CoreMedia Blueprint comes with different possibilities to customize the location where new content should be created with the "Quick Create" dialog and the component FolderChooserListView. This section describes the available target folder calculation and customization options of this component.

The target folder is determined in the following order:

  1. FolderChooserListView Lookup Methods
  2. Last used folder
  3. Custom "folderPathsExpression" Expression
  4. Content Creation Settings
  5. EditorPreferences
  6. Folder Bookmarks
FolderChooserListView Lookup Methods

The component for the folder selection FolderChooserListView supports lookup methods that you can register, so that the target folder can be calculated dynamically. Find an example in the class BlueprintFormsStudioPlugin. This default implementation uses the selected folder in the library (if opened) for creating a new content.

        Config(EditorMainView, {
  plugins: [
    Config(AddDefaultFolderChooserEntry, { lookup: (content: Content, contentType:ContentType): any => {
        if(contentType.isSubtypeOf("CMArticle")) {
          return "/Sites/MySite/English/Articles/";
        }

        //not applicable? let's continue with other lookups methods and variants
        return null;
      } }),
  ],
}),

      

Example 9.148. Adding a FolderChooserListView lookup method


Note that the method is not called in a "dependency-tracked" context, which means it can't return undefined in order to be evaluated again when content is loaded inside it. When null is returned, the target folder evaluation is continued with the next lookup method or with the next strategy described here.

Last Used Folders

When a user creates content through the "New Content" dialog, the location is stored inside a history in the EditorPreferences content of this user. This logic is part of the FolderChooserListView component and can not be customized.

Custom "folderPathsExpression" Expression

If you use the FolderChooserListView in a custom component or dialog, you can configure the parameter folderPathsExpression for it. This expression can contain a fixed path or can be a FunctionValueExpression which calculates the target folder. The return value of the expression can be a string array with different paths or undefined, if the calculation is not finished yet.

Content Creation Settings

The easiest way to customize the target location for new content is to configure the settings content Content Creation. You can create it inside the global settings folder /Settings/Options/Settings/ or site specific settings folders Options/Settings/.

The settings content must contain a link list with name paths which contains a mapping from the content type to the desired target folders. You can find examples in the CoreMedia Blueprint default content.

EditorPreferences

The EditorPreference settings content is used as another fallback for looking up content creation mappings. These settings are used the same way as Content Creation settings, but the name of the Struct property is contentCreationPaths instead.

Folder Bookmarks

If none of the above strategies returns a folder, the user's bookmarks are checked for folder bookmarks and suggested for the content creation.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.