Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Craig100 1136 posts 2523 karma points c-trib
    May 27, 2016 @ 08:45
    Craig100
    0

    Editing Relations

    Hi,

    We have a multi-lingual site which consists of 4 English sites of various cultures plus FR, ES & DE. At the moment, maintaining relations between them has been easy as we just copy from the en-gb site and change the copy. Shortly we'll need to add several Spanish and a couple of French language sites. We already have a Spanish and French site but if we copy from those to save the editors time (and RSIs) then the parent relation ID will no longer be the en-gb site and so our hreflang system will break.

    My question is, is there a way to edit the relations table in UaaS so we CAN say copy the ES site 5 times and change the copy's parent relation IDs to the en-gb site, like you can with a "normal" Umbraco site by editing the relation table in the DB. An interface would be good :)

    Any advice appreciated.

    Craig

  • Sebastiaan Janssen 5045 posts 15477 karma points MVP admin hq
    May 27, 2016 @ 09:59
    Sebastiaan Janssen
    0

    So if I understand correctly you want to copy a Spanish site but reset the relation to be to the English version, correct?

    I think this can be done programmatically. I haven't tried this but I imagine this:

    • hook into the ContentService.Copied event
    • look up the existing relation of the node being copied (using RelationService)
    • set the relation on the new node to the original English node

    You should probably not click "relate to original" in the interface though, I'm not sure which relation would take precedence.

    I don't know how well this scales for you either.

    The other option is to try the relations editor: https://our.umbraco.org/projects/backoffice-extensions/umbraco-relation-editor/

    But it seems like it doesn't work on 7.3+ and you would probably have to do this for each node.

    Alternatively, you could write a little dashboard where you give it two root nodes:

    Original node (for ex. Spanish) New (copied) node (for ex. Mexican Spanish)

    Then you loop through all of the old nodes, find the relation and set them on the corresponding copied node. In that case you WOULD want to use the "relate to original" checkbox so you can find which ones belong to each other and then reset the relation.

    Hope that makes sense!

  • Craig100 1136 posts 2523 karma points c-trib
    May 27, 2016 @ 10:14
    Craig100
    0

    Thanks Sebastiaan,

    Yes you are correct, copy a site and reset it's pages' parent relations to a different one.

    I'm thinking maybe add a control to a home page tab (for each site) allowing that site's parent relations to be set to another site's that can be set with a content picker. As you say, it would only work providing the "relate to original" is checked. But it is by default so should be ok.

    If a "relate to original" isn't checked, then I guess no entry would be made in the relations table at all and you wouldn't be able to find the site to be changed in the table. So might have to handle that situation by creating relations from scratch.

    Thanks for the suggestions. All food for thought :)

Please Sign in or register to post replies

Write your reply to:

Draft