is it possible to force editors to select the "Relate copied items to original" checkbox when they copy documents? I would require that for multilingual page switcher.. Can it be configured somewhere?
I'm not sure that it's possible to hook into the event that triggers the content menu to show. I think this may require you to compile your own version of Umbraco perhaps.
Why do you need to make sure that the "relate copied items to original" checkbox is checked?
I have a multilingual site with the ability to switch the language on every page and getting directly to the right page in the chosen language (not just to the home page). So if you are on the english products page and click the german flag, you get directly to the german products page. To get this information in the language switcher macro (to generate the links) I use the relation data. Therefor I would like to assure that if an editor copies new content, the relationship is created.
That sounds like a neat solution you have made there - I got a little inspired for the next multi-language site when I get the task of making one again.
Unfortunately I have not come across a solution to your request. But maybe some others in here know how it can be done.
as I figured out, using the built-in document relationship feature on copying, its pretty easy to implement such a precise language switching. I only have to provide 2 languages for the site, it will be a little more complex with more languages, but I think it would also be possible, and its probably the best way to achieve that today with Umbraco...
I haven't tried this, but maybe you could use an event handler that triggers on the Copy event, and just create the relation yourself (regardless of the checkbox) via API?
Hmm, yes I think Tom is on to something here...If you need to set the relationship using the API I guess it should really just be a matter of hooking into the create event of a node and do the relation stuff?
FYI, some code to get you started if you need it - to create a relation progamatically.
One thing I'm not sure about is if the Copy event passes both the original and new node ID's - I think it didn't in the past but it might have been added/fixed in 4.6
Hendy's Relation Types Dashboard project also makes it easy to create/manage your relation types. His blog also has some good info on getting started with relations API.
FYI, if you have uComponents installed, there are some helper methods to extend the RelationType object to be able to retrieve the associated ObjectType GUIDs, and to ensure that any relations created don't conflict with these specified types, as well as a couple of other methods.
Relate copied items to original
Hello,
is it possible to force editors to select the "Relate copied items to original" checkbox when they copy documents?
I would require that for multilingual page switcher.. Can it be configured somewhere?
Best Regards
Andreas
Hi Andreas
I'm not sure that it's possible to hook into the event that triggers the content menu to show. I think this may require you to compile your own version of Umbraco perhaps.
Why do you need to make sure that the "relate copied items to original" checkbox is checked?
/Jan
Hello Jan,
thanks for your reply.
I have a multilingual site with the ability to switch the language on every page and getting directly to the right page in the chosen language (not just to the home page). So if you are on the english products page and click the german flag, you get directly to the german products page. To get this information in the language switcher macro (to generate the links) I use the relation data. Therefor I would like to assure that if an editor copies new content, the relationship is created.
Best Regards
Andreas
Hi Andreas
That sounds like a neat solution you have made there - I got a little inspired for the next multi-language site when I get the task of making one again.
Unfortunately I have not come across a solution to your request. But maybe some others in here know how it can be done.
Cheers
/Jan
Hi Jan,
as I figured out, using the built-in document relationship feature on copying, its pretty easy to implement such a precise language switching. I only have to provide 2 languages for the site, it will be a little more complex with more languages, but I think it would also be possible, and its probably the best way to achieve that today with Umbraco...
Best Regards
Andreas
I haven't tried this, but maybe you could use an event handler that triggers on the Copy event, and just create the relation yourself (regardless of the checkbox) via API?
Hi again
Hmm, yes I think Tom is on to something here...If you need to set the relationship using the API I guess it should really just be a matter of hooking into the create event of a node and do the relation stuff?
In case you have not seen it there is a overview of the events here: http://our.umbraco.org/wiki/reference/api-cheatsheet/using-applicationbase-to-register-events/overview-of-all-events
/Jan
Alright, thank you very much!
FYI, some code to get you started if you need it - to create a relation progamatically.
One thing I'm not sure about is if the Copy event passes both the original and new node ID's - I think it didn't in the past but it might have been added/fixed in 4.6
Hendy's Relation Types Dashboard project also makes it easy to create/manage your relation types. His blog also has some good info on getting started with relations API.
Thats great to know! Thank you!
Hi,
FYI, if you have uComponents installed, there are some helper methods to extend the RelationType object to be able to retrieve the associated ObjectType GUIDs, and to ensure that any relations created don't conflict with these specified types, as well as a couple of other methods.
HTH,
Hendy
Thanks, very helpful!
is working on a reply...