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.

1 Answer 1

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

1
  • Thanks! I had already looked into extensiongroups but I didn't add the resourceextensions. It is working now. Aug 1, 2014 at 10:06

Your Answer

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

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