Bundle manager

Bundle manager #

The bundle-manager is a container field for creating a file-manager form for managing the assets of page bundles. The word page bundle refers to Hugo’s Page Bundles. A page bundle is a way of organizing a page inside it’s own directory together with it’s resources.

It’s not possible to use Bundle managers with pages which are not stored as page bundle.

Bundle Manager together with a Bundle Image Thumbnail

Bundle Manager together with a Bundle Image Thumbnail

Bundle Manager with Bundle Image Thumbnail and extra string fields

Bundle Manager with Bundle Image Thumbnail and extra string fields

Bundle image thumbnail #

The bundle-image-thumbnail field is a special field to be used together with bundle-manager containers. It’s creates preview image thumbnails of selected images.

Read [bundle-image-thumbnail documentation](https://book.quiqr.org/docs/20-quiqr-developer-reference/03-content-model/03-form-fields/layout-field-types/bundle-image-thumbnail/) for more information.

Properties #

propertyvalue typeoptionaldescription
keystringmandatoryKeys are for internal use and must be unique
titlestringoptionalThe title of the element
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.
maxItemsintegeroptionalmax amount of files allowed to add
forceFileNamestringoptionalwhen forceFileName is set to a filename, the uploaded file is renamed to this filename including it’s extension. When forceFileName is set maxItems is automatically set to 1 NOTE, files are not converted, it’s wise to only allow the same extension
extensionsarrayoptionalList of allowed filetypes
addButtonLocationTopboolean (default: false)optionalShow add button on top of the widget in stead of at the bottom
fieldsarrayoptionalList of fields as subform

Sample 1 #

Configuration #

./quiqr/model/base.
     
extensions:
- jpg
- png
- jpeg
- pdf
- svg
fields:
- key: thumb
  type: bundle-image-thumbnail
key: images
path: images
title: Images
type: bundle-manager
extensions = ["jpg", "png", "jpeg", "pdf", "svg"]
key = "images"
path = "images"
title = "Images"
type = "bundle-manager"

[[fields]]
  key = "thumb"
  type = "bundle-image-thumbnail"
{
   "extensions": [
      "jpg",
      "png",
      "jpeg",
      "pdf",
      "svg"
   ],
   "fields": [
      {
         "key": "thumb",
         "type": "bundle-image-thumbnail"
      }
   ],
   "key": "images",
   "path": "images",
   "title": "Images",
   "type": "bundle-manager"
}

Output #

 ..
 content/portfolio/item2
 ├── images/
 │  ├── backgound-image.jpg
 │  └── foregound-image.jpg
 └── index.md
 static/
 themes/
 ..

Sample 2 #

This configuration looks the same but the path starts with a /

Configuration #

./quiqr/model/base.
     
extensions:
- jpg
- png
- jpeg
- pdf
- svg
fields:
- key: thumb
  type: bundle-image-thumbnail
key: site_images
path: /static/images
title: Site Images
type: bundle-manager
extensions = ["jpg", "png", "jpeg", "pdf", "svg"]
key = "site_images"
path = "/static/images"
title = "Site Images"
type = "bundle-manager"

[[fields]]
  key = "thumb"
  type = "bundle-image-thumbnail"
{
   "extensions": [
      "jpg",
      "png",
      "jpeg",
      "pdf",
      "svg"
   ],
   "fields": [
      {
         "key": "thumb",
         "type": "bundle-image-thumbnail"
      }
   ],
   "key": "site_images",
   "path": "/static/images",
   "title": "Site Images",
   "type": "bundle-manager"
}

Output #

 ..
 content/
 static/
 └── images/
    ├── image1.jpg
    └── image2.jpg
 themes/
 ..

Known issues #

A bug currently prevents the values of input fields to be saved in the frontmatter.