Skip to content

Instantly share code, notes, and snippets.

@mooror
Last active April 21, 2016 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mooror/a9374644563ddbbb3509f80baf71a5af to your computer and use it in GitHub Desktop.
Save mooror/a9374644563ddbbb3509f80baf71a5af to your computer and use it in GitHub Desktop.
# Add this to your config.yml file
BlogPost:
extension:
-YoutubeIdBlogPostExtension
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");
}
}
@mooror
Copy link
Author

mooror commented Apr 21, 2016

This is a simple DataExtension class that adds a youtubeId field to the blogpost page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment