Jump to:

1842 Posts in 1600 Topics by 558 members

Blog Module

SilverStripe Forums » Blog Module » Images in blog posts

Discuss the Blog Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 672 Views
  • neros3
    Avatar
    Community Member
    51 Posts

    Images in blog posts Link to this post

    Hi

    Does anyone ever wanted to allow users (with no access to CMS) to add images to a blog post?
    I sure did tons of times, and always wondered why I couldn't.

    Do you have a fancy solution for that?

    Thank you!

  • Bambii7
    Avatar
    Community Member
    254 Posts

    Re: Images in blog posts Link to this post

    For SS3

    class BlogEntryDecorator extends DataExtension {
       
       public static $has_one = array(
          "Image" => "Image"
       );
       
       public function updateCMSFields(\FieldList $fields) {
          $fields->addFieldToTab( 'Root.Main', new UploadField('Image', 'Image'), 'Content' );
          return $fields;
       }
       
    }

    672 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.