|Number of votes:||1|
Then this post might be something for you.
This post will guide you through how to switch the standard ASP.NET Mvc view engine and use the Spark View Engine instead. The idea with Spark is to allow html to dominate the flow and the code to fit seamlessly into it.
Download the latest Spark View Engine; extract the files and copy Spark.dll and Spark.Web.Mvc.dll to the Public Templates bin folder.
Open the Public Templates project and add both assemblies to project references, you also need to add System.Web.Mvc and System.ServiceModel.Web.
Add two new folders to the project root: Controllers and Views.
Add a new controller to the Controllers folder, call it SparkyController.cs.
If we dig a little deeper inside the code you will see that we map the model to the Feed class returned by the Sparky controller, this is equal to
that you would write in a regular Asp.NET MVC view. We do this because we want to have a strongly typed model in the view.
Ok, now we have created the view and the controller and the project should compile. However the gadget will not appear in the gadget list and the web server won’t recognize the .spark as a Spark view. So we need to do a couple of more things before everything works.
First we need EPiServer.Shell to recognize Public Templates as Shell Module. Open web.config and scroll down to <episerver.shell> and add/update the publicModules list to include the Public Templates.
Then we have to register the Spark View Engine so that MVC will recognize the .spark as a spark view.
Open Global.asax.cs and add the Spark View Engine to Application_Start.
Now it should be possible to add the “Yet Another Feed Reader” gadget to the dashboard and read the latest Wired top stories.