8

I would like to be able to only load a JavaScript file when the current view is a ComponentView.

So something in the lines of:

<cfg:group name ="groupname" applyTo="ComponentView">
  <cfg:fileset>
    <cfg:file type="script">/javascriptfile.js</cfg:file>
  </cfg:fileset>
</cfg:group>

Is there something available like this?

I know that you can do this within JavaScript ($display.getView()getId() === "ComponentView") but then the file is already loaded.

7

You need to extend associated View group. In case of ComponentView it is Tridion.Web.UI.Editors.CME.Views.Component

See how to make groupextensions from Eric answer in similar post:

Component Fields available in GUI Extension with fieldBuilder

| improve this answer | |
  • Thanks! I had already looked into extensiongroups but I didn't add the resourceextensions. It is working now. – Thomas Hendrickx Aug 1 '14 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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