diff --git a/_config/routes.yml b/_config/routes.yml index e31876da8..95273ebc4 100644 --- a/_config/routes.yml +++ b/_config/routes.yml @@ -1,4 +1,11 @@ --- +Name: rootroutes +Before: '*' +--- +Director: + rules: + '': 'Controller' +--- Name: coreroutes After: cms/routes#modelascontrollerroutes Before: '*' @@ -19,5 +26,4 @@ After: framework/routes#coreroutes Director: rules: 'admin': 'AdminRootController' - '': 'RootURLController' - 'dev/buildcache/$Action': 'RebuildStaticCacheTask' + 'dev/buildcache/$Action': 'RebuildStaticCacheTask' \ No newline at end of file diff --git a/control/Controller.php b/control/Controller.php index d526f3a36..c1264fb08 100644 --- a/control/Controller.php +++ b/control/Controller.php @@ -274,6 +274,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider { $templates = $this->template; } else { // Add action-specific templates for inheritance chain + $templates = array(); $parentClass = $this->class; if($action && $action != 'index') { $parentClass = $this->class; @@ -289,9 +290,12 @@ class Controller extends RequestHandler implements TemplateGlobalProvider { $parentClass = get_parent_class($parentClass); } + $templates[] = 'Controller'; + // remove duplicates $templates = array_unique($templates); } + return new SSViewer($templates); } diff --git a/templates/Controller.ss b/templates/Controller.ss new file mode 100644 index 000000000..3d787bea1 --- /dev/null +++ b/templates/Controller.ss @@ -0,0 +1,22 @@ + + + + + + <% base_tag %> + + $MetaTags + + +

<% if $Title %>$Title<% else %>Welcome to SilverStripe<% end_if %>

+ <% if $Content %>$Content<% else %> +

To get started with the SilverStripe framework:

+
    +
  1. Create a Controller subclass (doc.silverstripe.org/sapphire/en/topics/controller)
  2. +
  3. Setup the routes to your Controller.
  4. +
  5. Create a template for your Controller (doc.silverstripe.org/sapphire/en/trunk/reference/templates)
  6. +
+ <% end_if %> +

Generated with the default Controller.ss template.

+ +