I would like to do something when the user clicks "Cancel Editing" button in Tridion 2013 XPM. Below is my configuratin file and JS file. My Extension's Java Script file has been loaded in the page. But when i click the "Cancel" button looks like JS is not fired. I am having alert in all the sections (isavailable, isenabled and execute). Can anyone please point me out what i am doing wrong?

Is there any specific section in "system.config" file to add the SiteEdit related extension details? (VDIR and Extension location)

Congiguration File

   <?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 cache="true">
        <cfg:group name="xpmextension.CommandSet">
            <cfg:file type="script">/js/xpmextension.js</cfg:file>
            <cfg:file type="reference">xpmextension.Interface</cfg:file>
        <ext:editorextension target="SiteEdit">
          <ext:editurls />
              <ext:command name="CancelEditing" extendingcommand="xpmextension"/>
      <cfg:commandset id="xpmextension.intereface">
        <cfg:command name="xpmextension" implementation="Extensions.xpmextension"/>

Below is my JS file


          Extensions.xpmextension = function Extensions$xpmextension()
           Type.enableInterface(this, "Extensions.xpmextension");
           this.addInterface("Tridion.Cme.Command", ["xpmextension"]);

          Extensions.xpmextension.prototype.isAvailable = function xpmextension$isAvailable(selection) {
          return true;

          Extensions.xpmextension.prototype.isEnabled = function xpmextension$isEnabled(selection) {
          return true;

              Extensions.xpmextension.prototype._execute = function xpmextension$_execute(selection) 
              alert("You have clicked the button");

  • Have you tried to debug the extension, is the JS loaded correctly and is it just the _execute command which is not triggered? Feb 19 '15 at 16:17
  • Hi Bart, JS is loaded perfectly, i have alert in isavailable, isenabled and exectue. none of the alerts are triggered. when i click cancel button. I have tried with other button (SignOff) as well.
    – Jey
    Feb 20 '15 at 4:59
  • When none of the alerts are triggered, I would say your JS is not perfectly loaded, or at the very least not bound correctly. Feb 20 '15 at 7:04
  • JS file loaded at the last bottom when i check this url domain/WebUI/Editors/SiteEdit/Views/…. Is there anything wrong in my configuration file?
    – Jey
    Feb 20 '15 at 7:10
  • Have you reset the modification attribute in the config? Feb 20 '15 at 10:03

You have at least one typo in your configuration file that I could spot so quickly, xpmextension.intereface vs xpmextension.Interface.

Not sure if that is the only thing, I usually don't try to look too much at the config because it is confusing me a lot, so what I tend to do is take a working config and start from there.

What I've done to test your scenario is took a basic setup of a UI Extension Editor, and wired it up like you tried to the CancelEditing command.

It is deployed as a regular web application under ..\Tridion\web\WebUI\Editors\Example\, then added as a virtual directory in the SDL Tridion website, and in the System.config I've inserted the following inside the /configuration/editors element:

<editor name="Example">

When using my sample code, I get the alert fired when I press the Cancel Editing button, thats roughly what I did to test ;o).

You can download the source of the extension here: https://drive.google.com/file/d/0B3HC5g1nQ87sWUdfcmZRWGdUQzQ/view, hope it helps you getting along.

Just check the references and paths, build it and publish it (note there is a post build which copies the DLL to the Tridion WebUI location, so be sure to change its path accordingly or comment the post build command out completely).

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.