Your own project component
When the built-in blocks are not enough, the site adds its own component. Here there are three:
an install command builder, a plan calculator and footer links. Docara
does not change: the components live in the site’s own smart/ folder.
Choose another system or version in the example window: the install command changes at once. You can copy it with the “Copy” button.
How it works
- Each component is a folder in
smart/named likeproject.name. manifest.jsondescribes the component: its parameters (props), places for nested elements (slots) and its style and script files.view/default.jsonbuilds the component from ready SIMAI Framework elements:ui.dropdownlists,ui.inputfields andui.checkboxcheckboxes. The Russian labels sit next to it inview/ru.json; the Russian page picks that view with"view":"ru".template/default.phpis the markup Docara outputs during the build. A script fromassets/brings it to life in the browser.
On a page, you call the component the same way as SIMAI Framework components:
project-demos.md
:::project.install-builder
{"title":"Build the install command","package":"simai/docara","version":"^3.0"}
:::
What you can change
| File | What changes in it |
|---|---|
manifest.json |
The component parameters and the allowed nested elements |
view/default.json |
Which elements are inside and with which labels |
template/default.php |
The markup around the elements |
assets/*.css, assets/*.js |
Appearance and behaviour in the browser |
The example components send nothing over the network: the builder only assembles the command, and the calculator computes the total in the browser.