-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic support for layouts outside MVC. #117
base: master
Are you sure you want to change the base?
Conversation
Hey thanks for picking this up. It's a frequently requested feature. I've not looked at RazorEngine 3.5, but I assume we should be OK to upgrade. |
Can this be merged please? |
Must have |
We really need this. |
Sorry everyone, I haven't had any spare time to work on this. Probably won't for a while either. Someone else feel free to pick it up. This PR does work as is though, with the limitations mentioned above. Or you can plug it into the current Nuget version of Postal. I'm doing it like this currently: https://gist.github.com/tystol/9fd4db5e42d5d1943e60 Working well for me so far. |
Thanks @tystol , I actually just upgraded your code to use the latest API from RazorEngine and so far it seems to do the trick. |
For anyone else dealing with this issue here's the upgrade of the gist @tystol posted for the newest version of RazorEngine https://gist.github.com/mbcrawfo/2269f5a1a402792ff2d8 |
+1 for merging this |
This is a very quick spike to get layouts working via the RazorEngine.
The layout name must be the path to the layout file, relative from the root path specified when constructing the
FileSystemRazorViewEngine
. (e.g. asp.net styleLayout = "~\Views\EmailLayout.cshtml"
is not supported).I can put some more time into this, but before proceeding wanted to check if it's ok to upgrade the RazorEngine version used. It currently uses 3.4.1, and 3.5 introduced quite a few API changes, so I'd rather upgrade to that before writing too much code against the old API.