2

I'm working on GUI extension for Experience Manager.

Extension supposed to have the next functionality:

  1. Handle content “drop” event
  2. Detect regionId and componentId
  3. Send pair regionId/componentId to web service
  4. Web service saves regionId/componentId to page metadata

In such way we try to save region-component mapping.

I have the next implementation.

Configuration:

<cfg:extensiongroup name="ABC.Resources.ExtensionGroups.RegionHandler">
  <cfg:extension target="Tridion.Web.UI.Editors.SiteEdit.Views.EditorViewFiles">
    <cfg:insertafter>ABC.Resources.Groups.RegionHandler</cfg:insertafter>
  </cfg:extension>
</cfg:extensiongroup>

<cfg:group name="ABC.Resources.Groups.RegionHandler">
  <cfg:fileset>
    <cfg:file type="script">/js/RegionHandler.js</cfg:file>
  </cfg:fileset>
  <cfg:dependencies>
    <cfg:dependency>ABC.Resources.Groups.Common</cfg:dependency>
  </cfg:dependencies>
</cfg:group>

JavaScript:


ABC.SlotsTool.RegionHandler = {

    init: function () {
        Tridion.EventRegister.addEventHandler(Tridion.Web.UI.Editors.XPMCore.Controls.DragManager, "drop", Tridion.Web.UI.Editors.XPMCore.Controls.Page.getDelegate(function () { alert('hello'); }));
    }

};

$j(function () {
    ABC.SlotsTool.RegionHandler.init();
});

JavaScript is not working. Do you know an alternative way to subscript for “drop” event?

Thank you

  • Have you tried debugging it? Do you know if your code is even getting called? The only thing I can see that seems strange is that you are getting a delegate from the Page object. Technically that should still work - it just seems odd to me. – Peter Kjaer Jul 9 '15 at 12:54
  • Interesting scenario, Mark. I'm curious, what happens with the Region-Component mapping after its stored in Page Metadata? – Alvin Reyes Jul 9 '15 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.