Skip to content

Instantly share code, notes, and snippets.

@webbower
webbower / page-metatags
Created March 28, 2012 02:13
SilverStripe Page::MetaTags override
<?php
public function MetaTags($includeTitle = true) {
$tags = "";
if($includeTitle === true || $includeTitle == 'true') {
$tags .= HTML::tag('title', Convert::raw2xml(($this->MetaTitle) ? $this->MetaTitle : $this->Title)) . "\n";
}
$charset = ContentNegotiator::get_encoding();
if(HTML::is_html5()) {
$tags .= HTML::tag('meta', '', array('charset' => $charset)) . "\n";