Articles, products, and other dynamic entities frequently contain text fields. A single text field often constitutes the body of an article, for example. Even though text fields are capable of many things, they are rather limited when it comes to including things such as image galleries or two columns of content. Content Management Systems (CMSs) often get around this issue by:
Allow the users to paste HTML code directly into these text fields.
Add pre-styled blocks that can be used to style content.
The first option is convenient, but not very user-friendly since it requires knowledge of HTML and CSS, and it can be dangerous for people who don't know what they're doing. The second option is better, but we must add a list of pre-styled blocks, limiting our creativity.
Nilead CMS solves the above issue by taking the 2nd option with a tweak:
The blocks/widgets can be styled as usual using the powerful Visual Editor.
Those blocks/widgets can be injected into the text area at any position and can be configured to customize the content accordingly.
We call these specialized blocks/widgets shortcuts for now (just a convenient name we came up with to distinguish them from other types of widgets). Just a few minor differences separate shortcuts from other widgets:
You must include these shortcuts directly inside rich-text widgets (they should be direct children of rich-text widgets).
Styles, effects, etc... can be applied to these shortcuts and their children as usual.
NOTE: In general, shortcuts should be used only for text widgets displaying dynamic content (such as an article's content). Static content can be easily styled using the Visual Editor, so shortcuts are not necessary.
A shortcut must be created within a richtext element.
Identify which richtext element you want to add the shortcut to.
Select the Configurable Transparent provider from the element panel and add it to that richtext element.
Use the contextual menu to make the newly added Configurable Transparent provider a Shortcut.
Add anything you want to the Configurable Transparent provider and style it accordingly.
Make sure to check the `Optimize` option configuration of the richtext element.
A Configurable Transparent provider serves as an intermediary for data transmission. In this specific case, it can be used to allow you to configure your data right within the richtext area. It will be easier to explain by reading the following tutorials:
Add a nice styled Note shortcut for your articles.
Add a beautiful gallery shortcut for your articles.
NOTE: Data mapping works as usual inside your shortcut(s). Data can be mapped directly from the global context or from your Configurable Transparent provider. Whenever possible, you should map data directly from the global context, leaving minimal configurable data inputs for the shortcut.
You can add more than one shortcut to your richtext element. Feel free to add as many as you want. It should be noted that these shortcuts will not be rendered unless they are included within text. A shortcut is simply a `template` and can be included more than once within your text.
We have added a new widget/shortcut icon to the richtext's editor. When you click on this icon, a shortcut's placeholder will be added to your text. You can then:
Select the shortcut you want to use.
Configure the shortcut accordingly.
It's very important to note that:
The shortcut you want to use must be available inside the richtext widget element that prints out this text. Otherwise, the shortcut will be ignored and will not be printed out.
If you delete or disable the shortcut via the Visual Editor, the shortcuts you already included in your text will be ignored and will not be printed out.
You need to know which shortcuts you can use for your text (which shortcuts are already added to the richtext widget). Currently, when you include the shortcut from any text field you can select ALL shortcuts available globally. If the shortcut you select is not already included within the richtext element that prints out your text field then the shortcut section will simply be ignored and not printed out.
You need to remove the shortcuts you include within your text manually after you removed the shortcuts from richtext elements. You can also leave them there but they will simply be ignored and not printed out.
If you are working on an article via the CMS, you can only preview how the included shortcuts are printed out by using the preview feature.