Skip to content

Create Silex components

Alex Hoyau edited this page May 2, 2019 · 21 revisions

This document is a work in progress, we need your help, ask questions in the issues and add info here please

About components

Silex components are elements you can add to a website through the "+" menu. They are created with a tool called "Prodotype" which compiles them for Silex and generates the UI.

Screenshot from 2019-03-15 15-32-05

Why components

  • Empower your users with new tools
  • The UI is generated, you just need to describe the parameters
  • It is like a widget (simple HTML code you put in an HTML box) but your users can not view the code, and can edit parameters in a UI

How to contribute components

The components files live in src/prodotype/components/. Each component is made of an HTML template (.ejs file) and a description file in a markdown file (.md).

Components files are compiled with the command npm run build:prodotype

If you add components - thank you! Please make a pull request and after it is merged update the documentation wiki.

Add components to your own instance

You can also add components on your instance only and for your users only. There is an example of this in this repo.

In short, Silex is included in your project as an npm dependency. You add components in Silex folder and rebuild components.

How to create components

Components are made of 2 files: a text file which describes its properties, and an HTML template which use the properties to render the component.

Links:

WARNING: Support for Silex v2 has stopped. Try Silex v3 alpha, Read about it, Subscribe to the newsletter

Clone this wiki locally