String Writer

my tech stuffs…

Get TcmId from web dav url

leave a comment »

Many of tridion developer would have tried to get tcm id from web dav. This might be one of the common scenarios where we are using web dav when we are rendering embedded components (in another component template).

I think this is simple scenario so I’m just sharing C# code snippet for this. I’m posting this snippet becoz somebody was googling this yesterday ;) ))


IdentifiableObject identifiableObject = engine.GetObject("<<Web dav url>>");
package.PushItem("TCMID", package.CreateStringItem(ContentType.Text, identifiableObject.Id));

Written by visvabalaji

January 10, 2012 at 5:52 pm

Posted in SourceCode, Tridion

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.