...
Level | When to apply rules here: | |
---|---|---|
1 | Application defaults | These can only be changed by Styla developers by deploying changes to the Layout Engine (Styla front-end) project. If you create a new front and don't configure any Theme or Module settings, every module will use these defaults. By configuring settings you override these. If you configure something in a wrong way, the application will probably fall back to these defaults. |
2 | Front | These are CSS and other settings influencing any piece of content you create for this front. "front" is Styla lingo for a store or a locale within an organization (client). If you change one of them in the future, the changes will be applied retroactively to any existing content. This CSS is fetched from the top-level settings every time a Styla page is requested. |
3 | Presets for Modules | If you want to use several style variants of a module, you can apply some changes with the Editor UI and then reuse the resulting preset for any module of the same type. Which means that by selecting a different preset from the dropdown in the "Settings" tab, a different set of CSS rules will be applied. You can also apply any CSS rule to any HTML node, even if there is no UI for it in the Editor. CSS from such preset will be merged into any other CSS applied for the module and override any module settings from the higher levels. If you update a preset itself, you need to reapply it to all modules you need the changes to be reflected on. Creating presets only makes sense if they really will be reused on multiple modules. |
4 | Module instance | You can apply CSS settings on a single module level as well - with the Editor UI or directly in the JSON editor. This makes sense if you only want the changes to be applied to one module and don't want to reuse them. |
...
Organization Manager (admin.styla.eu)
The Organization Manager tool in which you create new organizations, fronts and users, is also where you configure CSS per front. You do this in the THEME SETTINGS and MODULE SETTINGS tabs:
...
Any JSON you enter into the Organization Manager or Editor will be validated before saving. If it's invalid the changes won't be saved and will be lost, so if you're planning to enter a big chunk of JSON into the editor, better validate it somewhere else beforehand or back it up. The best approach is small incremental changes.
...
Expand | ||
---|---|---|
| ||
|
Setting up Module Presets
If your client need several appearance variants of the same module and cannot achieve it with the default set of presets available for every client, you will need to create a set of custom presets for them.
As the Editor features a UI to create and manage such presets, clients themselves can create presets there. But the usual UI in the Editor does not enable them to apply any CSS property to any HTML element. Therefore, you will need to set up some more advanced things directly in module JSON data.
Here’s how you create a preset:
Log in as the target user/domain, click your user name top-right, then "Preset Manager" on the overlay menu.
Click "the Create" button top-left of the list. Then select module type from the dropdown, fill in the new Preset's name and click "Create" bottom-right.
Configure any CSS properties you can with the usual Editor UI on the next screen and click "Save changes" top-right.
Anything you cannot configure with the UI, you need to enter into this module's styles JSON directly.
Click the "edit as JSON" button bottom-left or simply add /json to the page's URL and then add nodes for HTML elements and their CSS properties as you'd do in the domain's Module settings.
Once you are done, save the changes and check desktop and module preview if the modules looks all right. You will probably need to go through several iterations.
Once this is done, the CSS and other settings from the preset you've just created can be applied to any other module of the same type with the "Presets" dropdown in the "Settings" tab. They will be saved in the "presets" node of its JSON data and merged to any other CSS it already has set. In case the same CSS property is set differently on both of them, the original settings in the module will prevail, being on a lower-level.
The preset that you've created will be available in the "Preset Manager" until you remove it. You can modify its JSON data and the changes will be reflected on any module you apply the preset to. The changes won't be automatically reflected on the modules you'd applied the preset to before. You'll need to re-apply it.
Info |
---|
Presets that you set in the way described above are added in the templateModuleIds JSON node in Theme settings, as in the example below: You can copy this into another domain to reuse the presets. |