Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript on ribbon group
    primarykey
    data
    text
    <p>I managed to get a new ribbon group by following the article mentioned in <a href="https://stackoverflow.com/questions/11682702/how-to-create-the-custom-buttons-horizontally-one-below-the-other-in-ribbon-of-t">How to create the custom buttons horizontally one below the other in ribbon of Tridion</a></p> <p>I'm now trying to get a Javascript running whenever something changes in the Gui (hiding/showing buttons). </p> <p>I have this in the configuration:</p> <pre class="lang-xml prettyprint-override"><code>&lt;!-- In the cfg:groups part --&gt; &lt;cfg:group name="ClientGuiMods.ContentGroup" description=""&gt; &lt;cfg:fileset&gt; &lt;cfg:file type="script"&gt;/Scripts/CreateRibbonGroup.js&lt;/cfg:file&gt; &lt;/cfg:fileset&gt; &lt;cfg:dependencies&gt; &lt;cfg:dependency&gt;Tridion.Web.UI.Editors.CME&lt;/cfg:dependency&gt; &lt;/cfg:dependencies&gt; &lt;/cfg:group&gt; &lt;!-- In the ribbontoolbars add part --&gt; &lt;ext:extension pageid="HomePage" name="Content" assignid="ContentGroupId"&gt; &lt;ext:group&gt;~/Scripts/ContentGroup.ascx&lt;/ext:group&gt; &lt;ext:dependencies&gt; &lt;cfg:dependency&gt;ClientGuiMods.ContentGroup&lt;/cfg:dependency&gt; &lt;/ext:dependencies&gt; &lt;ext:apply&gt; &lt;ext:view name="DashboardView"&gt; &lt;ext:control id="DashboardToolbar" /&gt; &lt;/ext:view&gt; &lt;/ext:apply&gt; &lt;/ext:extension&gt; </code></pre> <p>And this in the Javascript:</p> <pre class="lang-js prettyprint-override"><code>Type.registerNamespace("ClientGuiMods"); ClientGuiMods.ContentGroup = function ContentGroup(element) { console.log('RibbonGroupCreated'); Tridion.OO.enableInterface(this, "ClientGuiMods.ContentGroup"); this.addInterface("Tridion.Controls.RibbonItemsGroup", [element]); }; </code></pre> <p>I've tried different arguments for this.addInterface(), but it never gets called. Is this the correct way? Or is there maybe another way to get a script called on the Home ribbon toolbar?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COIt's not at all clear what you are trying to do. What do you mean by "I'm now trying to get a Javascript running whenever something changes in the Gui (hiding/showing buttons)."? Normally you would implement a Command, which you would then hook up to a button. If the command is enabled, the button will be enabled, etc. Then when the button is clicked, the command is executed. The buttons will regularly be updated automatically, such as when the selection changes in the list.
      singulars
    2. CO@PeterKjaer: I have a ribbon button group, made from an ascx. This part I accomplished by following the article from Bart. I now have a ribbon button group with some button that are also on the home and create ribbons. What I'm trying to accomplish now is to hide the buttons (or commands) that are unavailable, same thing that's happening on the CreateRibbonPage. The difference with the CreateRibbonPage is that I'm doing this all in a ribbon group. I could do this on every button, but then I would probably need to implement each button individually.
      singulars
    3. COBottomline is I want to accomplish the same thing I can on a ribbon page, but on just a ribbon group. The solution I provided hooks into the ribbon page where the ribbon group is added (Home in this example) and run the logic here. I'm all open for a better solution.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload