mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-49891 theme_bootstrapbase: Add meta data description to frontpage
This commit is contained in:
parent
dda862abb5
commit
5e9a937bba
@ -27,6 +27,26 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
|
||||
/** @var custom_menu_item language The language menu if created */
|
||||
protected $language = null;
|
||||
|
||||
/**
|
||||
* The standard tags that should be included in the <head> tag
|
||||
* including a meta description for the front page
|
||||
*
|
||||
* @return string HTML fragment.
|
||||
*/
|
||||
public function standard_head_html() {
|
||||
global $SITE, $PAGE;
|
||||
|
||||
$output = parent::standard_head_html();
|
||||
if ($PAGE->pagelayout == 'frontpage') {
|
||||
$summary = s(strip_tags(format_text($SITE->summary, FORMAT_HTML)));
|
||||
if (!empty($summary)) {
|
||||
$output .= "<meta name=\"description\" content=\"$summary\" />\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/*
|
||||
* This renders the navbar.
|
||||
* Uses bootstrap compatible html.
|
||||
|
@ -6,6 +6,9 @@ information provided here is intended especially for theme designer.
|
||||
* The renderer function core_availability_renderer::multiple_messages was changed to
|
||||
render_core_availability_multiple_messages, requiring a parameter of the new
|
||||
\core_availability\multiple_messages type.
|
||||
* Meta description is now included in standard_head_html for homepage in bootstrapbase.
|
||||
If your theme includes a meta description directly in a layout for the frontpage,
|
||||
you will need to remove it or override the standard_head_html instead.
|
||||
|
||||
=== 2.9 ===
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user