Visibility API
tjholowaychuk - September 3, 2007 - 00:31
Brief description:
This module provides an API for controlling the visibility of arbitrary elements, similar to block visibility settings in Drupal Core. The 6.x version of the module also provides form creation helper functions. There is currently no upgrade path from the 5.x to the 6.x version of the module.
Key Features:
- Role specific visibility settings.
- Path specific visibility settings
- Show only on paths %
- Do not show on paths %
- Allows wildcards Example: products/*
- JavaScript inclusion / exclusion by CSS selectors (currently 5.x only)
How to use the 5.x version:
- visibility_api_access($key, $path = '');
-
Every widget using specific visiblity api access must have a visibility_api_key.
The function above will simply return TRUE or FALSE if all visibility criteria are met, an optional path can be entered to check paths other than the current path.
-
Every widget using specific visiblity api access must have a visibility_api_key.
- visibility_api_form_configuration($key, &$form, $js = FALSE);
- A UI is provided to the user by simply adding this function into your settings form code. $visibility_api_key being a unique indentifier specific to your module or widget. $form being of course the form which you would like to add the visibility_api configuration form. When $js is TRUE additional form elements are provided to allow the user to also include / exclude by CSS selectors.
- NOTE: the submission values are automatically captured and saved.
Known Modules using Visibility API:
5.x
6.x
The 5.x version of this module was developed by vision media, 6.x by Sprocket.
Releases
| Official releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 5.x-1.2-6 | 2008-Apr-21 | 8.67 KB | Download · Release notes | Recommended for 5.x | |
| Development snapshots | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.x-dev | 2009-Jul-30 | 10.71 KB | Download · Release notes | Development snapshot | |
