Last active
April 21, 2016 02:02
-
-
Save mooror/a9374644563ddbbb3509f80baf71a5af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your config.yml file | |
BlogPost: | |
extension: | |
-YoutubeIdBlogPostExtension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class YoutubeIdBlogPostExtension extends DataExtension { | |
private static $db = array( | |
'YoutubeId' => 'Varchar', | |
); | |
public function updateCMSFields(FieldList $fields) { | |
$fields->addFieldToTab("Root.Main", new TextField('YoutubeId','Youtube Video Id'), "Content"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a simple DataExtension class that adds a youtubeId field to the blogpost page.