6

After following the great answer in this post, I can now insert, order and remove columns from the lists in the CME. I am only doing this for ECL folders at the moment (by extending the ECL editor).

However, our system has 3 ECL providers, and each one has a different set of columns which need to be displayed. How can I target a list definition at a specific ECL provider? I did see there is an @idmatch attribute for list definitions, but it is not clear to me how that should be used.

1 Answer 1

8

@idmatch is the regular expression mask which if applied to list parent ID, then definition associated is applied to the List.

To extend existing views you should configure listdefinion section in ext:listdefinitions from your extension configuration. Like it is done at Gitgub config Example from previous post.

ECL items has a mask /^ecl:\d+-(?'providerId'[^\s-]+)-.*/ so you can define your list definition based on a provider ID.

For Instance for UIBeardcore provider if I'll use uibc as a provided ID the regexp mask for folders will be like /^ecl:\d+-uibc-.*-folder$/

However, in your scenario, @handler attribute is also probably worth to be taken into account. This attribute might be configured next to @idmatch.

<listdefinition
    idmatch="^ecl:\d+-uibc-.*-folder$"
    url="/Xml/Definitions/HandlerListDefinition.xml"
    handler="UIBeardcore.Editors.ListExtensions.DefinitionHandlers.HandleExtensionItemDefinition"/>

The intention of it is to add a definition path resolver:

Type.registerNamespace("UIBeardcore.Editors.ListExtensions.DefinitionHandlers");

UIBeardcore.Editors.ListExtensions.DefinitionHandlers.HandleExtensionItemDefinition = function UIBeardcore$Translators$HandleExtensionItemDefinition(editorName, view, controlId, itemId)
{
    if ($models.getItemType(itemId) == $const.ItemType.FOLDER)
    {
        return $config.expandEditorPath("/Xml/Definitions/FolderListDefinition.xml", editorName);
    }

    return $config.expandEditorPath("/Xml/Definitions/ListDefinition.xml", editorName);
};

So you will have more space to implement definitions selections based on multiple conditions and information which might be accessed client side.

UPDATED: Added an article Extensibility | Resolving List Definitions to Tridion.UIBeardcore blog.

4
  • I am a bit confused by the handler - is this mandatory to get my new list definition to load? Also - What do you mean by "you will have more space..."? - Thanks, Chris Jun 21, 2013 at 11:54
  • In list definitions you are defining associations between the list container (list parent item) and list representation (which is configured in lst definitions). You can make this association through RegExp mask of a list parent id which is @idmatch. And JavaScript resolver (defined in @handler, not mandatory attribute). With idmatch regExp you have only itemId. In handler (path resolver) you have an acces to entire runtime. Jun 21, 2013 at 12:36
  • Great - so I now have that working for extending the CME editor, but for some reason it is not working when I extend the ECL Editor. Could there be any difference between these? The handler code does not seem to even get hit for ECL. Jun 21, 2013 at 13:18
  • If you are extending lists in dashboard, then you only need to extend CME, as Dashboard (and dashboard based views) is a part of CME editor. If you are extending any part of ECL editor then make sure you have all location attribues defined correctly, such as Configuration/extensions/ext:editorextensions/ext:editorextension[@target='ECL']/ext:listdefinitions/view[@name='ExtendingView']/control[id='ExtendingControl']/.. Jun 21, 2013 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.