This project is not covered by Drupal’s security advisory policy.

Conditional Text module for Drupal

This module adds a text filter called "Conditional text" to your site. The conditional text filter allows you to write content for your site that contains sections that are displayed or hidden depending on certain conditions, allowing you to write content that can be used in different situations or for different audiences. For example, if you are writing software documentation, you might want to write content explaining how to use a particular feature, and include certain sections that apply to one version of the software, and other sections that apply to another version. If you were displaying this documentation to a user of one version, you would hide the inapplicable information from the other version. This allows you to avoid duplicating the content (which makes it more difficult to maintain) -- instead of writing a different manual for each version, you write one version with conditional sections.

This module uses a plugin system to define the available conditions and display options. Condition plugins allow you to define different types of conditional sections in your content. Display plugins govern how the conditional content is displayed. How this works:
a) When filtering content for display, the main module looks for sections in your content with the syntax:
[condition TYPE DETAILS](conditional text here)[/condition]
where TYPE is the name of an installed condition plugin, and DETAILS are specific to each condition type.
b) The condition plugin evaluates DETAILS to see whether the condition is considered "true" or "false". This can depend on who is viewing the content, what versions of what modules are enabled on your site, and other factors, depending on the condition plugin.
c) The display plugin decides how to render the (conditional text here), depending on whether the condition was true or false.

This module comes with several condition and display plugins (details below); other modules may provide additional plugins (to write your own plugins, see the conditional_text.api.php file).

Dependencies:

Common errors:
- If you have "Fatal error: undefined function" error, update the abstractions module. Conditional text always requires the latest version of abstractions.

Project information

  • caution Seeking co-maintainer(s)
    Maintainers are looking for help reviewing issues.
  • caution No further development
    No longer developed by its maintainers.
  • Created by tamasd on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases