mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
ENHANCEMENT #2700 - Added section title to CMS title tag
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@62894 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1844173308
commit
366ceda590
@ -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.
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
||||
<% base_tag %>
|
||||
<title>$ApplicationName</title>
|
||||
<title>$ApplicationName | $SectionTitle</title>
|
||||
</head>
|
||||
|
||||
<body class="stillLoading $CSSClasses">
|
||||
|
Loading…
Reference in New Issue
Block a user