Skip to content

Instantly share code, notes, and snippets.

@citizenmatt
Created September 16, 2011 15:37
Show Gist options
  • Save citizenmatt/1222387 to your computer and use it in GitHub Desktop.
Save citizenmatt/1222387 to your computer and use it in GitHub Desktop.
Spark using ThemeDescriptorFilter
public ActionResult Blah()
{
return View();
}
<html>
<head>
<title>Stuff</title>
</head>
<body>
things
<use file="_mypartial" />
</body>
<html>
<h1>SAUSAGES!</h1>
using Spark;
using Spark.Web.Mvc;
using Spark.Web.Mvc.Descriptors;
[assembly: WebActivator.PreApplicationStartMethod(typeof(SparkThemes.App_Start.SparkWebMvc), "Start")]
namespace SparkThemes.App_Start {
public static class SparkWebMvc {
public static void Start() {
var settings = new SparkSettings();
settings.SetAutomaticEncoding(true);
var container = SparkEngineStarter.CreateContainer(settings);
container.AddFilter(ThemeDescriptorFilter.For(context => "Matt"));
// Note: you can change the list of namespace and assembly
// references in Views\Shared\_global.spark
SparkEngineStarter.RegisterViewEngine(container);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment