Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tystol
Copy link

@tystol tystol commented May 9, 2015

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 style Layout = "~\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.

@andrewdavey
Copy link
Owner

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.

@ajbeaven
Copy link

Can this be merged please?

@quedicesebas
Copy link

Must have

@bcronje
Copy link

bcronje commented Oct 30, 2015

We really need this.

@tystol
Copy link
Author

tystol commented Oct 31, 2015

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.

@bcronje
Copy link

bcronje commented Oct 31, 2015

Thanks @tystol , I actually just upgraded your code to use the latest API from RazorEngine and so far it seems to do the trick.

@mbcrawfo
Copy link

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

@vip32
Copy link

vip32 commented Feb 12, 2016

+1 for merging this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants