1

I need to get the parent root publication (a publication which is at the topmost in the hierachy) from a specific child publication at any level in the hierarchy. I need to use TOM API and not core service. Could somebody please help me in achieving it with the best way?

We are using Tridion 2013.

  • Get current publication .Parent collection, until the current publication has no parents? I'm sure there's a much nicer way to do this, but you are in a hurry :) – Nuno Linhares Aug 30 '16 at 16:00
  • food for thought: tridion.stackexchange.com/questions/4681/… – Raj Kumar Aug 30 '16 at 16:10
  • I need the most optimized way please (want to avoid looping through the parents). – Shubh Aug 30 '16 at 16:26
2

Thanks All. I got solution to my issue using the following approach:

SystemManager manager = Session.SystemManager;
BluePrintParentsFilter  bluePrintParentFilter = new BluePrintParentsFilte(Session)
{
 ForRepository = publication
};

IEnumerable<Repository> bluePrintParents = manager.GetBluePrintParents(bluePrintParentsFilter);

and then iterating through the collection to check the Parents count. If count is 0 then just come out of the iteration with the root publication.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.