Developer forum

Forum » Development » Get virtual path to the current template

Get virtual path to the current template

Daniel Plomp
Reply

Hi all,

Probably a fairly simple question to which I hope someone knows the answer.

I currently use a custom PageTemplateExtender and I'd like to know how to get the virtual path of the template that is being rendered.

If I use this code the following code, I get only a portion of the path and it includes the filename:
PageView.Area.get_Value("arealayout").ToString().

Is there a way to get a VirtualPath of this 'arealayout' out of the box?

Best,
Daniel

 


Replies

 
Mikkel Ricky
Reply

The template tag Template:BaseUrl holds the base url (virtual directory) of the current template. Is that what you're looking for?

Best regards,
Mikkel

 
Daniel Plomp
Reply

Hi Mikkel,

Is there a way to find this through the API?

Best,
Daniel
 

 
Mikkel Ricky
Reply

No API methods on the Template object exposes information needed to compute the virtual template path. What are you trying to achieve?

 

You must be logged in to post in the forum