About
ReConfigs is a feature that allows you to Override a Configuration Value.
For example, when the enable configuration is turned on in the Configs View Mode Widget,
the view mode button will be appear on all pages. In certain cases, you may want to disable it on specific page or post,
For this purpose you can use ReConfigs.
Support
Not all configuration items support this feature. Refer to the Widget Configuration Data to know whenever the configuration is supported for ReConfigs or not - (View).
Usage
Currently, ReConfigs is only supported in the Post Editor and Page Editor.
In this example, ReConfigs is applied in the Post Editor.
- Open Post Editor in HTML Mode.
-
Define ReConfigs HTML using the following format:
<div class='w-reconfigs' data-config-name='value'></div>- config-name is a combination of ReConfigs Prefix and Configuration Name. For configuration name, replace all _ (dash) with - (underscore).
EXAMPLE: In Configs View Mode Widget documentation page, there are two configuration items that support ReConfigs: enable and default_mode. To override these configurations, refer to the ReConfigs Prefix found in Widget Specification Data, the prefix is view-mode - (See).
Based on ReConfigs Prefix and Configuration Name, you can override this configuration using the following HTML:
ReConfigs HTML with One Configuration:<div class='w-reconfigs' data-view-mode-enable='no'></div>
ReConfigs HTML with Multiple Configurations:<div class='w-reconfigs' data-view-mode-enable='no' data-view-mode-default-mode='dark'></div>
- Place the ReConfigs HTML anywhere within the Post Editor - (See).
Others
-
Defining Multiple ReConfigs HTML
When there are many configuration items to add from different groups,
you can separate their definitions by creating multiple ReConfigs HTML elements.
Example:<div class='w-reconfigs' data-view-mode-enable='no' data-view-mode-default-mode='dark'></div> <div class='w-reconfigs' data-overlay-toc-enable='yes' data-overlay-toc-nested='no'></div>
-
Item Priority
When a configuration item appears in more than one ReConfigs HTML, the last one will be applied.
In the example below, data-view-mode-enable is present in two ReConfigs HTML elements.
In such cases, the Value from the second HTML element will be applied.
Example:<div class='w-reconfigs' data-view-mode-enable='no' data-view-mode-default-mode='dark'></div> <div class='w-reconfigs' data-view-mode-enable='yes' data-overlay-toc-enable='yes'></div>