Builder library

The component library allows you to reuse built content across pages and views, and to quickly get started Building pages By using ready-built content. Inside the builder, there are two different types of content you can drag from the left toolbox into the canvas: Components and library elements. The components are elementary and built into Saltcorn. The library on the other hand consists of assemblies of components that allow you to save time when building your page or view. You can add more items to the library - For instance, if all or most pages share a footer section, you could turn this into a library item so you only have to build it once and then replicate it on all the other pages.

Using the library

In the Builder, on the left-hand side you see the items you can drag into the page.  You can switch this between the components and the library by pressing the accordion headers. If your system does not currently have any library items, you will only see the Add button in the library section. In that case you can skip to the next section to learn how to add library items. if you do see items under the Add button, you can drag them into the canvas as any other element.  When dropped in the canvas they will be turned into their constituent components as if you had done the building from scratch.

Not every library element can be used in every instance of the builder. For instance, if your library element includes fields, it cannot be used on a page or in a filter, as fields are not in the available widgets when building pages or filters. In general the library will only show elements that can be used in the current builder context.

Adding an element to the library

To add an item to the library, first selected using by clicking on it in the canvas or in the layers. Then switch to the the library accordion on the left-hand side and click the Add button. A form appears where you enter the name and select the icon for the toolbox. You should keep the name short, eight characters or less so it fits in one of the item boxes. When you press the the Add button inside the form, this item will be added to the library. 

Deleting items

To delete an item from the library, go to the menu: Settings -> Site structure -> Library. There you can see a list of your library items and delete the ones you don't want to use anymore.