5

How does the Tridion GUI Extension config map the names to the JS file? For example, I am using Jaime's HelloWorld post with example files. The most important part feels to be the CommandSet section.

<cfg:commandset id="HelloWorldCM.Interface">   
  <cfg:command name="HelloWorldCM" implementation="Extensions.HW"/>
  <cfg:dependencies>
    <cfg:dependency>HelloWorldCM.Commandset</cfg:dependency>
  </cfg:dependencies>
</cfg:commandset>

Can someone please help me understand the following attributes and how they map to the underlying .js file for the extension?

  • name
  • implementation
  • cfg:dependency

I have tried changing these things in both config and js file but how they are mapped is a mystery.

1 Answer 1

10

The three attributes you mention are really all pointers that tie the whole extension together. If you look higher up in the Jamie's sample, you will see this:

<ext:contextmenus>
  <ext:add>
    <ext:extension name="HelloWorldCMExtension" assignid="" insertbefore="cm_refresh">
      <ext:menudeclaration>
        <cmenu:ContextMenuItem id="ext_HelloWorldCM" name="Hello World!" command="HelloWorldCM"/>
      </ext:menudeclaration>                            
      <ext:dependencies>
        <cfg:dependency>HelloWorldCM.Example</cfg:dependency>
      </ext:dependencies>              
      <ext:apply>
        <ext:view name="DashboardView"/>
      </ext:apply>
    </ext:extension>
  </ext:add>          
</ext:contextmenus>

This XML adds a button to the CME's context menu.

command="HelloWorldCM" refers to the command with the matching name attribute in the commandset

implementation="Extensions.HW" in the command set actually refers to the namespace in the accompanying HellowWorldCM.js file

cfg:dependency points to the top of the config file at the <cfg:group name="HelloWorldCM.Commandset" merger="Tridion.Web.UI.Core.Configuration.Resources.CommandGroupProcessor" merge="always"> node in order to know which CSS and JS to include.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

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.