Advertisement
Guest User

Untitled

a guest
May 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. class CustomFooter extends DataExtension {
  3.  
  4. static $db = array(
  5. 'FooterContent' => 'HTMLText',
  6. );
  7.  
  8. public static $has_one = array(
  9. "Logo"=>"Image",
  10. "BGImage"=>"Background Image"
  11. );
  12.  
  13. public function getCMSFields() {
  14. $this->extend('updateCMSFields', $fields);
  15. return $fields;
  16. }
  17.  
  18.  
  19.  
  20. public function updateCMSFields(FieldList $fields) {
  21. $fields->addFieldToTab('Root.Footer', new HTMLEditorField('FooterContent', 'Footer Content'));
  22. $fields->addFieldToTab('Root.Main', new UploadField('Logo','Company Logo'));
  23. $fields->addFieldToTab("Root.Main", new UploadField('BGImage','Background image'));
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement