Quantcast
Channel:
Viewing all articles
Browse latest Browse all 4235

Re: [SOLVED] How to input title tag metadata

$
0
0

Okay, I figured I would need to edit the page.php file like this. Wasn't sure if there was some way to add the field back in through the config.php file.

None the less, I did the following:

<?php
class Page extends SiteTree {

   // Adding the $MetaTitle variable back into SS3.
   private static $db = array(
'MetaTitle' => 'Text'
   );

   private static $has_one = array(
   );
   
   public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main.Metadata', new TextField('MetaTitle', $title = 'Meta Title'), $above = 'MetaDescription');
return $fields;
}

}


Posted to: [SOLVED] How to input title tag metadata | Show Thread | Post Reply


Viewing all articles
Browse latest Browse all 4235

Trending Articles