10

I have an Tridion.ContentManager.IdentifiableObject which may be a Page/Component etc and I wish to get the title of the publication it belongs to.

I am current able to get the publicationId like so:

IdentifiableObject.Id.PublicationId

but I wish to get the Publication title without doing a round trip to tridion. Is this possible?

JBB
  • 657
  • 5
  • 14
  • 1
    Nice question, could we interest you in committing to the [Area 51 Tridion specific proposal](http://area51.stackexchange.com/proposals/38335/tridion?referrer=gPujQMxthNCNn9xqeeO2NA2). Sign up with the same SO account if you have a moment. – Bart Koopman Dec 20 '12 at 11:56

1 Answers1

13

It is possible. First of all cast your object to RepositoryLocalObject instead of IdentifiableObject and then you can do:

var item = (RepositoryLocalObject) subject;
item.OwningRepository.Title;
johnwinter
  • 3,624
  • 15
  • 24
Andrey Marchuk
  • 13,301
  • 2
  • 36
  • 52
  • 6
    Depending on what you need, you could also get to the title of the ContextRepository (which is different from the OwningRepository if the item is shared). – Quirijn Dec 20 '12 at 11:18