How do you set up a select list to view images, thumbnail images in the list?

How do you set up a select list to view images, thumbnail images in the list?

koniahinkoniahin Posts: 186Questions: 39Answers: 7

I have a select list with a field $section_bg_image. It gets populated with a list of thumbnail images. With the images as ordinary text filenames it works to populate the list. If you know what the thumb file looks like then yes, it kind of works. But with any image list it is more useful to visually display a thumb.

I change the select options to display the label, but as an html image, and the value as the filename. I didn't really expect it to display the thumbs - and it doesn't. It is displaying the raw html for the image like:

<img src='/storage/images/backgrounds/$filename' /> $filename

In the popup editor is there a way to get it to render the html as html and display the thumb images alongside the filename?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Answer ✓

    A standard select cannot show images inside it. You would need to use a library such as Select2 (Editor integration here).

    Allan

  • koniahinkoniahin Posts: 186Questions: 39Answers: 7

    For the purpose intended this could never work even with select2 due to impracticality. Thumbnails are good for viewing normal images/pictures. In this case it would have been for background images. Dark, light, or anything in between, 60x60 or even larger thumbs could not reveal sufficient detail to make a decision. We will have to rely on the image filenames (sequential) and comparing them with those local on the computer. Will keep this in mind for other. Nothing further at this time.

Sign In or Register to comment.