Site structure
Version 5.x > Site structure > How to add additional document aliases using the API? View modes: 
User avatar
Member
Member
lancetek - 5/19/2011 6:01:02 AM
   
How to add additional document aliases using the API?
I need to add additional document aliases to some Articles using the API, and I can't find any references to it anywhere. I can find how to do it manually, but not using the API.

I'd expect 'document aliases' to be a property of the TreeNode object, but I don't see any collection properties that would be suitable.

Could someone please post some code or a link to the docs where I can get some insight on how this is done?

Thanks,
Lance

User avatar
Member
Member
lancetek - 5/19/2011 8:12:10 AM
   
RE:How to add additional document aliases using the API?
I dug around the source code and figured out how to do it. For anyone else looking:


CMS.TreeEngine.DocumentAliasInfo dai = new DocumentAliasInfo();
dai.AliasURLPath = newUrl;
dai.AliasCulture = "en-GB";
dai.AliasSiteID = 1;
dai.AliasNodeID = node.NodeID;
dai.SetObject();


Cheers,
Lance