Image Select

Image Select #

The image-select field creates a image selector picker field. It looks in a specified path for files to select. The output is a string with the filename.

Only one image can be selected.

Image Select in form

Image Select in form

Image Select dialog

Image Select dialog

Properties #

propertyvalue typeoptionaldescription
keystringmandatoryKeys are for internal use and must be unique
titlestringoptionalThe title of the element
tipstringoptional (default: null)Text entered here with markdown formatting is displayed as context help in an overlay box
defaultstringoptional (default: null)default value when the key is not set yet
autoSavebooleanoptional (default: false)Form data is automatically saved after changing the value
pathstringmandatoryThe path to the location of the files. When the path starts with / files are stored in the directory relative to the site root directory. Without a leading / files are stored in the directory relative to the where the markdown or data file is stored.
real_fs_pathstringoptional (default: null)The file system path the image. Use this e.g. when images are stored in /static/ or /assets/
buttonTitlestringoptional (default: “Select File”)Title of the button in the form.

Sample #

Configuration without real_fs_path #

./quiqr/model/base.
     
buttonTitle: select logo image
key: sample_field
path: /static/images
title: Sample field
type: image-select
buttonTitle = "select logo image"
key = "sample_field"
path = "/static/images"
title = "Sample field"
type = "image-select"
{
   "buttonTitle": "select logo image",
   "key": "sample_field",
   "path": "/static/images",
   "title": "Sample field",
   "type": "image-select"
}

frontmatter path will look like my-image.png

Configuration with real_fs_path (from 0.18.x) #

./quiqr/model/base.
     
buttonTitle: select logo image
key: sample_field
path: /images
real_fs_path: /static/images
title: Sample field
type: image-select
buttonTitle = "select logo image"
key = "sample_field"
path = "/images"
real_fs_path = "/static/images"
title = "Sample field"
type = "image-select"
{
   "buttonTitle": "select logo image",
   "key": "sample_field",
   "path": "/images",
   "real_fs_path": "/static/images",
   "title": "Sample field",
   "type": "image-select"
}

frontmatter path will look like /images/my-image.png

Output #

sample_field: logo.png