diff --git a/docs/en/Text-Templating-Razor.md b/docs/en/Text-Templating-Razor.md index 700d262b9b..14de2f3d2f 100644 --- a/docs/en/Text-Templating-Razor.md +++ b/docs/en/Text-Templating-Razor.md @@ -84,6 +84,7 @@ public class DemoTemplateDefinitionProvider : TemplateDefinitionProvider { context.Add( new TemplateDefinition("Hello") //template name: "Hello" + .WithRenderEngine(RazorTemplateRendererProvider.ProviderName) .WithVirtualFilePath( "/Demos/Hello/Hello.cshtml", //template content path isInlineLocalized: true @@ -97,6 +98,7 @@ public class DemoTemplateDefinitionProvider : TemplateDefinitionProvider * `TemplateDefinition` is the class represents a template. Each template must have a unique name (that will be used while you are rendering the template). * `/Demos/Hello/Hello.cshtml` is the path of the template file. * `isInlineLocalized` is used to declare if you are using a single template for all languages (`true`) or different templates for each language (`false`). See the Localization section below for more. +* `WithRenderEngine` method is used to set the render engine of the template. ### The Template Base @@ -223,7 +225,9 @@ context.Add( new TemplateDefinition( "PasswordReset", //Template name typeof(DemoResource) //LOCALIZATION RESOURCE - ).WithVirtualFilePath( + ) + .WithRenderEngine(RazorTemplateRendererProvider.ProviderName) + .WithVirtualFilePath( "/Demos/PasswordReset/PasswordReset.cshtml", //template content path isInlineLocalized: true ) @@ -271,6 +275,7 @@ context.Add( name: "WelcomeEmail", defaultCultureName: "en" ) + .WithRenderEngine(RazorTemplateRendererProvider.ProviderName) .WithVirtualFilePath( "/Demos/WelcomeEmail/Templates", //template content folder isInlineLocalized: false @@ -333,7 +338,9 @@ context.Add( new TemplateDefinition( "EmailLayout", isLayout: true //SET isLayout! - ).WithVirtualFilePath( + ) + .WithRenderEngine(RazorTemplateRendererProvider.ProviderName) + .WithVirtualFilePath( "/Demos/EmailLayout/EmailLayout.cshtml", isInlineLocalized: true ) @@ -348,7 +355,9 @@ context.Add( name: "WelcomeEmail", defaultCultureName: "en", layout: "EmailLayout" //Set the LAYOUT - ).WithVirtualFilePath( + ) + .WithRenderEngine(RazorTemplateRendererProvider.ProviderName) + .WithVirtualFilePath( "/Demos/WelcomeEmail/Templates", isInlineLocalized: false ) diff --git a/docs/en/Text-Templating-Scriban.md b/docs/en/Text-Templating-Scriban.md index 4d9be31dc8..8990e55cc4 100644 --- a/docs/en/Text-Templating-Scriban.md +++ b/docs/en/Text-Templating-Scriban.md @@ -49,6 +49,7 @@ public class DemoTemplateDefinitionProvider : TemplateDefinitionProvider "/Demos/Hello/Hello.tpl", //template content path isInlineLocalized: true ) + .WithRenderEngine(ScribanTemplateRendererProvider.ProviderName) ); } } @@ -58,6 +59,7 @@ public class DemoTemplateDefinitionProvider : TemplateDefinitionProvider * `TemplateDefinition` is the class represents a template. Each template must have a unique name (that will be used while you are rendering the template). * `/Demos/Hello/Hello.tpl` is the path of the template file. * `isInlineLocalized` is used to declare if you are using a single template for all languages (`true`) or different templates for each language (`false`). See the Localization section below for more. +* `WithRenderEngine` method is used to set the render engine of the template. ### The Template Content @@ -175,7 +177,9 @@ context.Add( new TemplateDefinition( "PasswordReset", //Template name typeof(DemoResource) //LOCALIZATION RESOURCE - ).WithVirtualFilePath( + ) + .WithRenderEngine(ScribanTemplateRendererProvider.ProviderName) + .WithVirtualFilePath( "/Demos/PasswordReset/PasswordReset.tpl", //template content path isInlineLocalized: true ) @@ -223,6 +227,7 @@ context.Add( name: "WelcomeEmail", defaultCultureName: "en" ) + .WithRenderEngine(ScribanTemplateRendererProvider.ProviderName) .WithVirtualFilePath( "/Demos/WelcomeEmail/Templates", //template content folder isInlineLocalized: false @@ -284,7 +289,9 @@ context.Add( new TemplateDefinition( "EmailLayout", isLayout: true //SET isLayout! - ).WithVirtualFilePath( + ) + .WithRenderEngine(ScribanTemplateRendererProvider.ProviderName) + .WithVirtualFilePath( "/Demos/EmailLayout/EmailLayout.tpl", isInlineLocalized: true ) @@ -299,7 +306,9 @@ context.Add( name: "WelcomeEmail", defaultCultureName: "en", layout: "EmailLayout" //Set the LAYOUT - ).WithVirtualFilePath( + ) + .WithRenderEngine(ScribanTemplateRendererProvider.ProviderName) + .WithVirtualFilePath( "/Demos/WelcomeEmail/Templates", isInlineLocalized: false ) diff --git a/docs/en/Text-Templating.md b/docs/en/Text-Templating.md index c9b03cd940..a2c55c7a54 100644 --- a/docs/en/Text-Templating.md +++ b/docs/en/Text-Templating.md @@ -24,6 +24,8 @@ ABP Framework provides two types of engines; * **[Razor](Text-Templating-Razor.md)** * **[Scriban](Text-Templating-Scriban.md)** +You can use different template engines at the same time, or even create a new template engine. + ## Source Code Get [the source code of the sample application](https://github.com/abpframework/abp-samples/tree/master/TextTemplateDemo) developed and referred through this document.