Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Custom image picker for CMS

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1235 Views
  • micahsheets
    Community Member
    164 Posts

    Custom image picker for CMS Link to this post

    I have a site where I want to add a field to the CMS where a button is pressed and a popup shows a list of predetermined thumbnails that can then be selected. I want to control the placement of the image on the page instead of having the CMS user try to place it using the tinymce interface.

    There is only one image per page and it is not selectable from the file system directly. We choose 30 images and put them in a folder with thumbnails. These thumbnails are then displayed for the user to pick one. Once the image is picked it goes into the database so that it can be rendered correctly on the page. Then once the image has been picked it the thumbnail would be displayed also in the CMS for that page and a button would be there for selecting a new one if need be.

    I know how to parse my folder of thumbnails and display them in a grid, what I don't know how to do is make it so when a thumbnail is clicked the database is updated with the path to the image without reloading the whole CMS page. I assume there is some ajax involved but don't know anything about that.

    Is there anything built in for this kind of functionality or can someone help me figure out the part where the image is clicked and the path saved so that the database is updated when the save or save and publish buttons are pressed?

  • dio5
    Community Member
    501 Posts

    Re: Custom image picker for CMS Link to this post

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.