3

I have tried to add a new command Extension in SDL 8.5 but when I restart the IIS and the services, The content manager doesn't load.

The extension modifies publishing buttons behaviour.

PublicationOptions.config

<cfg:filters />
<cfg:groups>    
    <cfg:group name="SDLWeb.Resources.PublicationOptions">
    <cfg:fileset>           
      <cfg:file type="script">js/PublicationOptions.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:editorextensions>
        <ext:editorextension target="CME" >
        <ext:editurls />
        <ext:listdefinitions />
        <ext:itemicons />
        <ext:taskbars />
        <ext:commands />
        <ext:commandextensions>
            <ext:commands>      
                <ext:command name="Publish" extendingcommand="PublicationOptions" />            
                <ext:command name="UnPublish" extendingcommand="PublicationOptions" />              
            </ext:commands>
            <ext:dependencies>
                <cfg:dependency>SDLWeb.Resources.PublicationOptions</cfg:dependency>
            </ext:dependencies>
        </ext:commandextensions>
        <ext:contextmenus />
        <ext:lists />
        <ext:tabpages />
        <ext:toolbars />
        <ext:ribbontoolbars />
        <ext:extendedareas />
        <ext:optionspanels />
    </ext:editorextension>
</ext:editorextensions>

<ext:dataextenders />

</extensions>

<commands>
    <cfg:commandset id="SDLWeb.Commands.PublicationOptions">
        <cfg:command name="PublicationOptions" implementation="SDLWeb.Tridion.CommandExtensions.PublicationOptions"/>         
        <cfg:dependencies>
            <cfg:dependency>SDLWeb.Resources.PublicationOptions</cfg:dependency>
        </cfg:dependencies>
    </cfg:commandset>   
</commands>

<contextmenus />

<localization />

<settings>
    <dependencies />
    <defaultpage />
    <editurls />
    <listdefinitions />
    <theme>
        <path>/Themes/</path>
    </theme>
    <customconfiguration />
</settings>

PublicationOptions.js

Type.registerNamespace("SDLWeb.Tridion.CommandExtensions");
SDLWeb.Tridion.CommandExtensions.PublicationOptions = function () {
        Tridion.OO.enableInterface(this, "SDLWeb.Tridion.CommandExtensions.PublicationOptions");
        this.addInterface("SDLWeb.Web.UI.Editors.Base.Commands.CommandBase", ["PublicationOptions"]);
};

SDLWeb.Tridion.CommandExtensions.PublicationOptions.prototype._isAvailable = function (selection, pipeline) {
  if (pipeline) {
                        pipeline.stop = true;
                    }
                    return false;
};


/*
*Checks whether to enable / disable the extension 
*/
SDLWeb.Tridion.CommandExtensions.PublicationOptions.prototype._isEnabled = function (selection, pipeline) {
    console.log("isEnabled");
    if (pipeline) {
        pipeline.stop = true;
    }
    return this._isAvailable(selection, pipeline);
};
/*
* default implementation
*/
SDLWeb.Tridion.CommandExtensions.PublicationOptions.prototype._execute = function (selection, pipeline) {
    if (pipeline) {
        pipeline.stop = false;
    }
};

System.config

<editor name="PublicationOptions">
  <installpath>D:\SDL Web\GUIExtensions\PublicationOptions\</installpath>
  <configuration>config\PublicationOptions.config</configuration>
  <vdir>PublicationOptions</vdir>
</editor>

Can anyone help me?

1
  • Check if there is any 500 error code in the NETWORK tab most for JS file "by using Developer tool", What is happening here is, because of the extension failed to load CME stopped responding... If there is 500 , change the customErrors of CME in the IIS and re-load the browser again. I hope this time you will see the error in the network tab.
    – Hem Kant
    Commented Jan 3, 2020 at 12:58

1 Answer 1

1

Frankly, to be honest, the CME doesn't load simply because your extension doesn't work. It is simple as that. Why it doesn't work, I cannot check from just these, you need to debug it thoroughly to see why is it so. It can be JavaScript issue, some other code issue, or just configuration issue. Debugging GUI extensions is tedious, hard process which in most cases resolves after weeks of investigation. Sorry to be so glooming, but it is what it is...

So to help you with debugging, check the following:

  • console logs in browser (log everything in console and verify it is being loaded)
  • IIS logs (they can help you with what is requested)
  • if you have some background/server code, check event viewer logs (check them in either case)
  • check, double-check and triple-check your configurations :D

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.