GUI extensions - resources that are not loading

I was a little confused what exactly I was doing wrong, so, hopefully, throwing this away, someone should be able to point out what, I hope, is obvious to me.

A new GUI extension is created, which will be placed as a button on the new tab "Events" of the Tridion ribbon panel. I can get the button to appear, however, the icon does not appear for the button and is always disabled, which makes me believe that the stylesheets and javascript for the extension are not loading: S

My editor configuration is as follows:

<?xml version="1.0"?> <Configuration xmlns="http://www.sdltridion.com/2009/GUI/Configuration/Merge" xmlns:cfg="http://www.sdltridion.com/2009/GUI/Configuration" xmlns:ext="http://www.sdltridion.com/2009/GUI/extensions" xmlns:cmenu="http://www.sdltridion.com/2009/GUI/extensions/ContextMenu"> <resources> <cfg:filters/> <cfg:groups> <cfg:group name="Events.Cvent"> <cfg:fileset> <cfg:file type="style">/Theme/cvent.css</cfg:file> <cfg:file type="reference">Events.Commands.Cvent</cfg:file> </cfg:fileset> </cfg:group> <cfg:group name="Events.Cvent.Commandset"> <cfg:fileset> <cfg:file type="script">/Scripts/cvent.js</cfg:file> </cfg:fileset> <cfg:dependencies> <cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency> <cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency> </cfg:dependencies> </cfg:group> </cfg:groups> </resources> <definitionfiles/> <extensions> <ext:dataextenders/> <ext:editorextensions> <ext:editorextension target="CME"> <ext:editurls/> <ext:listdefinitions/> <ext:taskbars/> <ext:commands/> <ext:commandextensions/> <ext:contextmenus/> <ext:lists/> <ext:tabpages/> <ext:toolbars/> <ext:ribbontoolbars> <ext:add> <ext:extension assignid="EventsPage" name="Events"> <ext:control/> <ext:pagetype/> <ext:apply> <ext:view name="DashboardView"> <ext:control id="DashboardToolbar"/> </ext:view> </ext:apply> </ext:extension> <ext:extension assignid="EventsAdministrationGroup" pageid="EventsPage" name="Administration"> <ext:group/> <ext:apply> <ext:view name="DashboardView"> <ext:control id="DashboardToolbar"/> </ext:view> </ext:apply> </ext:extension> <ext:extension assignid="CventBtn" groupid="EventsAdministrationGroup" name="Import Cvent Events" pageid="EventsPage"> <ext:command>Cvent</ext:command> <ext:title>Import Cvent Events</ext:title> <ext:dependencies> <cfg:dependency>Events.Cvent</cfg:dependency> </ext:dependencies> <ext:apply> <ext:view name="DashboardView"> <ext:control id="DashboardToolbar"/> </ext:view> </ext:apply> </ext:extension> </ext:add> </ext:ribbontoolbars> </ext:editorextension> </ext:editorextensions> <ext:modelextensions/> </extensions> <commands> <cfg:commandset id="Events.Commands.Cvent"> <cfg:command name="Cvent" implementation="Events.Commands.OpenCvent"/> <cfg:dependencies> <cfg:dependency>Events.Cvent.Commandset</cfg:dependency> </cfg:dependencies> </cfg:commandset> </commands> <contextmenus/> <localization/> <settings> <defaultpage/> <editurls/> <listdefinitions/> <theme> <path>/Theme/</path> </theme> <customconfiguration> <clientconfiguration xmlns="http://www.sdltridion.com/2009/GUI/Configuration/Merge"> <Cventurl xmlns="http://www.sdltridion.com/2009/GUI/Configuration/Merge">/Cvent/Cvent.aspx</Cventurl> </clientconfiguration> </customconfiguration> </settings> </Configuration> 

All resource files (javascript and css) I need in directories, as in accordance with the configuration. My JS for GUI is as follows:

 Type.registerNamespace("Events.Commands"); Events.Commands.OpenCvent = function Commands$OpenCvent(name) { Type.enableInterface(this, "Events.Commands.OpenCvent"); this.addInterface("Tridion.Cme.Command", ["Cvent"]); this.properties.url; }; Events.Commands.OpenCvent.prototype._isAvailable = function OpenCvent$_isAvailable(selection, pipeline) { return true; }; Events.Commands.OpenCvent.prototype._isEnabled = function OpenCvent$_isEnabled(selection, pipeline) { return true; }; Events.Commands.OpenCvent.prototype._execute = function OpenCvent$_execute(selection, pipeline) { window.open('www.google.com'); }; 

Restarting Tridion and still nothing, what am I doing wrong?

+7
source share
3 answers

Can you check if your files are included by loading CME with options? mode = js and? mode = css.

Do not forget that these files are heavily cached - and simply changing the configuration does not invalidate the cache. You need to either increase the @modification attribute in System.config (to invalidate the cache of all clients), or simply clear the browser cache manually (easiest when developing).

If your changes are not in these files, this is probably the problem with your editor configuration. As Chris noted, files are only included if something else is included that has a dependency on it. If you enable tracing, you can understand why your files are not included in the resulting log file (Tridion.Web.trace).

See section 6 of this article for more information on how to do this: http://www.sdltridionworld.com/articles/sdltridion2011/tutorials/debugging_the_tridion_2011_cme.aspx

+5
source

I canโ€™t tell you what exactly is wrong with your extension, but maybe you can take a look at the existing GUI extension (actually several extensions), and maybe you can compare what is wrong with yours. Take a look at PowerTools http://code.google.com/p/tridion-2011-power-tools/

Also some good examples at http://www.sdltridionworld.com , for example. http://www.sdltridionworld.com/articles/sdltridion2011/tutorials/GUIextensionIn8steps.aspx

+3
source

I believe that dependencies will not load unless they are used and referenced inside the nodes of the config command set. Could you include your full editor.config, not just the extract?

+1
source

All Articles