Templates in folders
See original GitHub issueI’m just starting to implement RL alpha3 in my 2.0 project. I’ve created a folder in Views/ called Mailers to store all my templates. The plan was to organise these so I have
/Shared <- for _Layout
/Folder1/Template1.cshtml
/Folder2/Template1.cshtml
But I’m not sure how to do this with the engine/key structure. If /Views/Mailers is my root engine, I can’t pass a subfolder in a key to get my core template. If I create the engine in the subfolder, it can’t find the template.
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Template Folders
Template folders provide a way to organize your Templates list. You create folders from the Templates page. Once you create one or more ......
Read more >Free Printable PDF Templates for Folders
Download easy-to-use, free folder templates from The Paper Mill Store & order matching paper, cardstock & envelopes for your project.
Read more >72 Free Presentation Folder Design Templates
Download free, presentation folder design templates for Adobe Illustrator & Photoshop. Browse hundreds of custom business folders created ...
Read more >How to Customize Your Folder and Library Templates ...
Make file management a breeze with folder and library templates for Windows.
Read more >Understanding Folder Templates
SmartVault creates a folder structure for your account called Folder Templates as you add clients, create engagements, and add and edit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for being confusing. Hope this helps.
So AdminWelcome is my template name, and its in the ContentRoot/Views/Mailers/Systems My Layout is ContentRoot/Views/Mailers/Shared/_Layout.cshtml though, because I use one template for all my emails.
If I’m setting the Systems folder as the engine path, I can’t access the Shared folder (because its a level above the root of the engine). If I set the Mailers folder as the root engine (the contents of which is in the screenshot), I’m not sure how to pass the folder and the template key (cshtml filename) to the engine to render. It doesn’t seem to like taking a path like “Systems/AdminWelcome” as the template key. What I want to be able to do is something like…
and in my template be putting
Templates are resolved taking as a start point - a root folder that you specify when you create an engine.
So root is your upper folder. Then when you resolve a template you specify the path for it: /Folder/Template1 and in @{ Layout = “/Shared/myLayout” }
Is that what you’ve been asking?