diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 79d1d530..eff3979a 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -342,6 +342,7 @@ class LeftAndMain extends Controller { return $menu; } + /** * Return a list of appropriate templates for this class, with the given suffix */ @@ -888,6 +889,18 @@ JS; return self::$application_link; } + /** + * Return the title of the current section, as shown on the main menu + */ + function SectionTitle() { + // Get menu - use obj() to cache it in the same place as the template engine + $menu = $this->obj('MainMenu'); + + foreach($menu as $menuItem) { + if($menuItem->LinkingMode == 'current') return $menuItem->Title; + } + } + /** * The application logo path. Customisable by calling * LeftAndMain::setLogo() - the first parameter. diff --git a/templates/LeftAndMain.ss b/templates/LeftAndMain.ss index a78812b0..b4d8c12c 100644 --- a/templates/LeftAndMain.ss +++ b/templates/LeftAndMain.ss @@ -3,7 +3,7 @@
<% base_tag %> -