Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4267 posts 9146 karma points MVP 2x admin c-trib
    Jan 23, 2015 @ 10:17
    Ismail Mayat
    0

    Create new relate on copy

    Hello,

    I am using umbraco 4.11.8 this is an inherited multilingual site.  When the client created the language nodes they copied the english master and then removed added pages, also they did not relate to original during the copy.  

    Now for seo purposes we want to add hreflang alternate link tags so for each page show the alternate language version if it exits.  So what we are looking to do is using relation types create new relate on copy relations for all the existing content is this possible todo? I have had a look in the developer section and under Relation types - Relate document on copy under Relations tab but cannot see how to add new relations, currently the list is empty as i do not have any relate on copy which is correct as the editors have never copied with relate on copy.  If this is not possible then i guess would have to add mntp picker and relation for it so then for each page tag up its different language version then i have similar relate on copy related links?

    Regards

     

    Ismail

  • shanem 39 posts 93 karma points
    Jan 23, 2015 @ 10:35
    shanem
    0

    Have you tried http://viziozrelationships.codeplex.com? I think you can add relations.

  • Morten Bock 1867 posts 2138 karma points MVP 2x admin c-trib
    Jan 23, 2015 @ 10:39
    Morten Bock
    0

    I can't remember if the API lets you do it, but the relation table is very simple, so if you know which nodes you want to relate, you could just do a direct sql insert?

  • Morten Bock 1867 posts 2138 karma points MVP 2x admin c-trib
    Jan 23, 2015 @ 10:43
    Morten Bock
    0

    Actually, I think we are creating relations like this: 

    RelationType copyType = RelationType.GetByAlias("relateDocumentOnCopy");
    Relation.MakeNew(parentId, childId, copyType, comment); 

  • Ismail Mayat 4267 posts 9146 karma points MVP 2x admin c-trib
    Jan 23, 2015 @ 11:01
    Ismail Mayat
    0

    Shanem, cool will take a look at that, Morten yup can do it with api but i need editors to do it.

    Regards

    Ismail

  • Sebastiaan Janssen 4834 posts 14219 karma points MVP admin hq
    Jan 23, 2015 @ 11:29
    Sebastiaan Janssen
    0

    @Morten Just as FYI those are obsoleted methods now, use the RelationService instead. http://our.umbraco.org/documentation/Reference/Management-v6/Services/RelationService

  • Morten Bock 1867 posts 2138 karma points MVP 2x admin c-trib
    Jan 23, 2015 @ 11:30
    Morten Bock
    0

    @Ismail Ahh, I didn't get the part that it was a manual editor task. I thought you wanted to batch update all the existing pages.

  • Morten Bock 1867 posts 2138 karma points MVP 2x admin c-trib
    Jan 23, 2015 @ 11:31
    Morten Bock
    0

    @Sebastian I know, but the opening question mentioned the solution is version 4.11.8 (And the site I took the code from is v. 4.9)

  • Ismail Mayat 4267 posts 9146 karma points MVP 2x admin c-trib
    Jan 23, 2015 @ 11:31
    Ismail Mayat
    0

    Sebastiaan,

    This is for umbraco 4.11.8 yuck inherited site nothing we can do there.  One more question though, lets say in multilingual site you create a new language site from english via a copy and you check relate items to original, does this mean after the copy you will have only relate from root to root or will all the child pages relate to their english equivalents?

    Regards

    Ismial

  • Morten Bock 1867 posts 2138 karma points MVP 2x admin c-trib
    Jan 23, 2015 @ 12:54
    Morten Bock
    0

    @Ismail If I recall correctly, copying a structure with "relate to original" will relate the entire tree. 

Please Sign in or register to post replies

Write your reply to:

Draft