Select uploaded images

This example shows how to enable selection of already uploaded images in Redactor. See the documentation for more details.

Code

<!-- element -->
<textarea id="entry">...</textarea>

<!-- call -->
<script>
let app = Redactor('#entry', {
    image: {
        upload: '/image-uploader-path/',
        select: '/images/images.json'
    }
});
</script>

Usage

JSON of images should be like this:

[
    {
        "thumb": "/images/image-thumbnail-1.jpg",
        "url": "/images/image-1.jpg",
        "id": "1",
        "title": "My Image 1"
    },
    {
        "thumb": "/images/image-thumbnail-2.jpg",
        "url": "/images/image-2.jpg",
        "id": "2",
        "title": "My Image 2"
    }
]

When id and title parameters are optional.