diff --git a/core/SSViewer.php b/core/SSViewer.php index 0b6de5d3e..359b8294b 100755 --- a/core/SSViewer.php +++ b/core/SSViewer.php @@ -87,6 +87,11 @@ class SSViewer { */ protected static $current_theme = null; + /** + * @var string + */ + protected static $current_custom_theme = null; + /** * Create a template from a string instead of a .ss file * @@ -101,6 +106,9 @@ class SSViewer { */ static function set_theme($theme) { self::$current_theme = $theme; + //Static publishing needs to have a theme set, otherwise it defaults to the content controller theme + if(!is_null($theme)) + self::$current_custom_theme=$theme; } /** @@ -110,6 +118,13 @@ class SSViewer { return self::$current_theme; } + /** + * @return string + */ + static function current_custom_theme(){ + return self::$current_custom_theme; + } + /** * Pass the SilverStripe template to be used. * @@ -904,4 +919,4 @@ function supressOutput() { return ""; } -?> +?> \ No newline at end of file