FAQ

How can I disable or remove Conditional Content?
Go to Dashboard > System & Settings > Conditional Content to completely turn off the add-on. By doing so, the menu item will disappear and all blocks will render as they would normally. Deleting is also possible, and is completely safe. Please note though that the database table that stores conditions will also removed.

What about Full Page Caching?
With FPC enabled, blocks won't be parsed by PHP anymore on subsequent requests. This improves performance, but doesn't work well when working with dynamic data or conditions. Conditional Content only works if:
1. Full page cache is globally disabled, or:
2. Full page cache is enabled when blocks support it and the block itself has caching disabled (either via the code or by manually disabling it via the 'Advanced' context menu dialog)


Are conditions AND or OR?
Conditions are AND, meaning that all conditions need to pass in order to render a block.


What happens if I duplicate a block?
The conditions won't be carried over from the original block.


What happens if I delete a block?
The associated conditions won't be deleted.


Are changes to the conditions saved right away?
Yes, any changes in the Conditional Content dialog are saved immediately against a block.

How can I add new checkers / conditions? (for developers only!)
You can hook into the 'on_conditional_content_load_checkers' event and either add new checkers or overwrite checkers. Here is an example:

\Concrete\Core\Support\Facade\Events::addListener('on_conditional_content_load_checkers', function($event) {
    $event->addChecker('name_of_your_checker', [
        'fqn' => \The\Full\Name\Space\YourClass::class,
    ]);
});

Another way is to override the config. You can copy the configuration file from /packages/conditional_content/config/checkers_override.php and to application/config/generated_overrides/conditional_content.php. You can then modify add your own checkers or use the ones from /packages/conditional_content/config/checkers.php.

You can copy one of the Checkers from packages/conditional_content/src/ConditionalContent/Checkers and e.g. copy it to your own package or application folder. Of course you have to change the namespace accordingly, and create a view file for your checker in case it's configurable. If a checker is configurable, it shows a popup after adding the checker or if you click on it. The 'Random' checker for example, is not configurable. It's either 1 or 0. The Weekday checker is, because the user wants to configure on which days the block should be visible.

When saving the configuration dialog, all the form data will be saved to a JSON column in the database. You can implement the `validate` method, in order to make sure the inserted data is actually correct.

When the block loads, it will go through all the conditions, load the associated checkers, and if one of the checkers returns `false` in the `shouldRender` method, it won't render / display the block.