Developer forum

Forum » Templates » Include xslt/cshtml in item types

Include xslt/cshtml in item types

Tómas Thorvardarson
Reply

I have an item type that uses a html template to render its properties/fields.

I need to include a xslt or razor template to render out fields of its child node which is also an item type.

I'm using the Include statement to do this.

<!--@Include( path-to-xslt-or-cshtml-file )-->

The problem is that it does not parse, it simply renders as text. Both the xslt and razor code is shown as un-parsed text.

Is it not possible to do this?

We are using DW version 8.3.1.1.

 

 

 

xslt-cshtml-include.png

Replies

 
Mikkel Ricky
Reply

You cannot @Include Razor or XSLT code from an HTML template. Any @Include is expanded, i.e. replaced with the content of the included file, before the template is processed and you cannot mix HTML and Razor or XSLT in the same template.

Best regards,
Mikkel


 

 

 

 

 

  

 

You must be logged in to post in the forum