SparkViewEngine/spark — pull request #23 by danlash (2011-11-07 22:49:15+00:00)
Title: Area prioritizaion

If you are using asp.net mvc areas you may find that some views do not work as well as layouts. There is already an issue logged that describes problems with the mvc areas implementation.

This pull request prioritizes the view search paths to include area view locations first.

It also adds area locations for explicit layouts as well as default layouts. If you have a view that is served by an area folder, you would expect that it would check if there is a layout inside that area before it checks the root layouts folders.

For example, if you have an _admin_ area and you want to display the _index_ view with a default admin themed layout, it should check if _~/areas/admin/views/layouts/admin.spark_ exists first rather than _~/views/layouts/admin.spark_. This reinforces the spirit of areas, but falls back to standard locations if that fails.

--

This pull request is based on the mvc2-net4 branch, and has been tested in that environment. I would assume that the same style of patch could be applied to master as well as the other mvc branches. If you would like I can create pull requests for those as well.