Question

I'm using the spark view engine outside of MVC to create HTML emails. I've pulled the common layout elements into a master (template) view (Application.spark) and referenced the master view from my *.spark files using <use master="Application.spark">. However, the HTML in the master view doesn't show up in my emails. Any idea how to do this? Is this even possible?

Was it helpful?

Solution

Spark doesn't need MSMVC specifically to have master layouts and views work together.

But unless you specifically supply your own version of the IDescriptorFilter, the DefaultDescriptorFilter will be used, and it expects that the Application.spark file is located in a folder called Shared or Layouts under the main Views folder. If it's in one of those two, you don't even need to reference it from any of your *.spark files, it will be used conventionally because of its name and location.

That's about all I can say from the info you've given, but I guess it could be something else, and I'd have to see some code or an example to help more...

Hope that helps, Rob

OTHER TIPS

I solved this by adding by adding Application.spark as template to the descriptor:

descriptor.AddTemplate("Application.spark");

and used ${Content["view"]} instead of <use content="view"/> in the template.

Let me know if you have any issues after trying it.

There is also a workitem at the CodePlex site: http://sparkviewengine.codeplex.com/workitem/9035

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top