Is it possible to attach an event when a Component is linked to another in the CMS GUI? Which is the event?

  • I would hazard a guess at yes for sure... What have you reviewed/attempted? What lines of thought do you have already? It may be that you can't attach to the main component window other than the submit - perhaps you'll need to add the code directly in the popup and see if you can attach to either an insert or a submit on that as I guess you're looking to test something about the item being linked as it's being linked? – Dylan .. Mark Saunders Aug 31 '18 at 8:22
  • For ecl components, I want to copy information from external metadata to the metadata ecl component tab. Usually a user doesn't have to save an ecl component. Only he has to assign to a parent component. I don't want that the content editor has to open an save all the ecl components only for execute this process. Better if we can do this automatic action when the component is linked. – Guskermitt Sep 3 '18 at 9:32

As far as the events system is concerned, actions in the GUI aren't interesting until you actually save a component. So yes, you can do something with an event, but it's the component save you need to catch. You can do this by subscribing your handler to the event with:

TSubject: Tridion.ContentManager.ContentManagement.Component TEvent: Tridion.ContentManager.Extensibility.Events.SaveEventArgs

| improve this answer | |
  • They probably don't apply for this use case, but there are now events for getting lists (for the UI) as well as the Notification API to broadcast information to clients. Again, not that they're appropriate here, it's just that "events" aren't only limited to the back end and there are newer features in the front end for extensions and integrations. – Alvin Reyes Sep 2 '18 at 9:31
  • Yes. As I commented above, It's related to ecl components. Usually you don't have to save it. You only need to assign to a parent component. And then, you save parent component and Tridion saves ecl copy component automatically but any event is thrown. An option is to find ecl components when a parent component is saved but I guess that I will be affecting to the "normal process" of saving components with ecl components assigned. – Guskermitt Sep 3 '18 at 9:35
  • I guess you can also hook into the “validate” event? (This approach would work in both interfaces GUI - when save is selected and XPM - when a component loses focus IIRC) - that way, if there's any issues you can cancel the save until the editor corrects whatever is required (e.g. missing data from the source for the ECL etc.) It would be best combined with a check in the event system, in case someone is using the API directly or another editor. – Dylan .. Mark Saunders Sep 3 '18 at 21:28

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.