Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Blog Module /

Discuss the Blog Module.

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

Images in blog posts


Reply


2 Posts   808 Views

Avatar
neros3

Community Member, 51 Posts

19 September 2013 at 4:26am

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!

Avatar
Bambii7

Community Member, 254 Posts

23 October 2013 at 1:42pm

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;
   }
   
}