Default Box
When you create a box plugin you can extend your class to recieve the following functionality.
New functions
- Implent function ->cache()
- If you create the function 'cache' and have it return cache parameters then caching for your box will be taken care of.
Example return value would be:array( 'cache' => BLOCK_CACHE_CONTENT_CACHE, 'cache_keys' => array( 'node' => array('node_type' => 'node_type'), 'os_og' => array('current' => 'current'), ));
Where 'cache' defines the type of caching to use, currently 'BLOCK_CACHE_CONTENT_CACHE' is the only option.
'cache_keys' defines when the cache for this block should be cleared. In the example above the cache will be cleared any time a node of type 'node_tpye' is saved within the current site. For more information on avalible keys see the "Views content cache" module. - Implent function ->access()
- Control when a widget is avalible to an administrator of a site, for example return false if a required feature for this block is not avalible.
Plugin Definition
- "title"
- A Title must be present for your plugin to be included in the list of avalible boxes
- Standard Vsite Widget keys
- Additionally your plugin definition can add any key provided in the vsite widgets hook.
- "module dependencies"
- You may provide an array of modules that should be enabled. This can include features and the box will be disabled if the feature is not enabled in the site.