I want to get a specific publication details including metadata using TOM.NET API by just passing the Title of the publication? Could you help me with the best way (which method to use etc.)?
We are using Tridion 2013 SP1. Thanks, Kevin
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI want to get a specific publication details including metadata using TOM.NET API by just passing the Title of the publication? Could you help me with the best way (which method to use etc.)?
We are using Tridion 2013 SP1. Thanks, Kevin
As Nuno mentioned in the comment, but I'll steal his points by making it an answer ;o). In Template code you can use the GetObject
method directly from the Engine
object available in a Template:
Publication pub = (Publication)engine.GetObject("/WebDAV/Publication%20Name");
If your code is used in an Event Handler, you can use the GetObject
method from the Session
object, which you get from the subject
(item the event is triggered on):
Publication pub = (Publication)subject.Session.GetObject("/WebDAV/Publication%20Name");