I am axious to explore more of the new Templates features, and I would like to have the TemplatePagesFeature only apply to a specific url route, can’t seem to get the settings configured right.
For example, if route starts with /templates/ look for files in subfolder “templates”. This isn’t quite enough, seems the FS has to be added to AppHost and can’t be directly on the Template feature.
Plugins.Add(new TemplatePagesFeature { VirtualFiles = new FileSystemVirtualFiles("~/templates".MapServerPath()) });
Use a new TemplateContext in a custom Route + Service impl, you don’t need to reimplement the entire TemplatePagesFeature. But you’ll need to return a PageResult with the pages you want to render.
Using a new TemplateContext won’t cache the compiled page, also if using TemplatePagesFeature in DebugMode will check for modified pages and reload them.
Are you running into any issues by just registering TemplatePagesFeature that you want it limited to a specific sub directory? Note you can easily ignore .html pages or configure it to use a different.htm extension with:
Mainly because I am not looking to host it as part of the webapp exactly, and have different format templates in different folders (xml, html, md…) for various scenarios. I guess in that case it will prob be best to use multiple Template Contexts and invoked from custom service routes.