Is it possible to attach an event when a Component is linked to another in the CMS GUI? Which is the event?
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
-
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
submit
- perhaps you'll need to add the code directly in the popup and see if you can attach to either aninsert
or asubmit
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