Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Cant list images in file store

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

Page: 1
Go to End
Author Topic: 449 Views
  • SCOTTinOZ
    Avatar
    Community Member
    4 Posts

    Cant list images in file store Link to this post

    I have recently upgraded from 2.4 and since then have lost the ability to select images using the TreeDropdownField

    when I click on it, nothing happens.

    example

    $fields->addFieldToTab('Root.Content.Slides', new LiteralField ($name = "literalfield", $content = "<h2>Left Slide Window</h2>"));
    $fields->addFieldToTab('Root.Content.Slides', new LiteralField ($name = "literalfield", $content = "<h4>Slide 1</h4>"));
    $fields->addFieldToTab('Root.Content.Slides', new TextField('SlideDescriptionShort1', 'Short description'));
    $fields->addFieldToTab('Root.Content.Slides', new TextField('SlideDescriptionLong1', 'Long description'));
    $fields->addFieldToTab('Root.Content.Slides', new TreeDropdownField('SlidePage1ID', 'Page', 'SiteTree'));
    $fields->addFieldToTab("Root.Content.Slides", new SimpleImageField('SlideImage1', 'Image'));

  • zenmonkey
    Avatar
    Community Member
    528 Posts

    Re: Cant list images in file store Link to this post

    I may be confused by your questions, is the TreeDropdown notworking or the SimpleImageField? You say you can't slect images with TreeDropdown but your example calls a apge realtion.

    If you're refering to the SimpleImageField,its been depricated and you should use UploadField http://api.silverstripe.org/3.0/forms/fields-files/SimpleImageField.html

    One of the great things with SS3 is Images can be a $has_many relation, and there is Gallery module that has a sortable UploadField for images that works quite well, so it may be worth looking into upgrading your code there too.

  • SCOTTinOZ
    Avatar
    Community Member
    4 Posts

    Re: Cant list images in file store Link to this post

    Image link
    http://imm.io/S6dX

    449 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.