BentoBox

The BentoBox2 Developer Hub

Welcome to the BentoBox2 developer hub. You'll find comprehensive guides and documentation to help you start working with BentoBox2 as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Developer Documentation

Template Configuration

Templates are configured in a json file with a name matching it's corresponding template. For instance, /templates/about.html would be configured by /config/about.json

These config files also define Custom Fields and Wireframes.

A template's custom fields are accessible when editing a page via the Pages/Nav panel in the administrator's panel. If a wireframe is defined, fields not in sections targeted by the wireframe will be contained in a Page Settings modal when editing the page.

This is a sample configuration file for an About template, which would be located at /templates/about.html, that uses all settings currently available. It renders an "Intro" section at the top of the wireframe, and a list of each of the location boxes below it. All of these settings are optional.

/*
   Sample About Template Configuration File
   /config/about.json
*/

{
  
  name: "About Template",
  /* The name of this template, as displayed in the Pages/Nav
     section of the administrator's panel when creating a page. */
  
  fields: {
    intro: {
      type: "section",
      
      title: "Dinner Menu",
        /* This specifies the text displayed on the wireframe box. */
      
  		items: {
        title: "text",
        content: "wysiwyg"
      }
    }
  },
  /* Custom fields that are editable via the Pages/Nav section
     of administrator's panel where ever this template is in use.
     The assigned values can be referenced in this template at
     {{ current.fields }} See the "Custom Fields" section of the
     documentation for more information. */
  
  wireframe:
  [
   "section-intro",
   "boxes-locations"
  ],
  /* A wireframe interface definition for this template. See the
     "Wireframes" section of the documentation for more information. */
  
  exclude_from_nav: false
  /* OPTIONAL: For pages that are partials or macros, it is important
     to hide them from available selections when users try to create a new page.
     Setting this value to 'true' will ensure this template is not shown in any
     dropdown in the Create Nav Item page. */
}

Template Configuration