Configuration presets
Last updated on
30 April 2025
Presets store configuration for derivation. There can be more active presets in a system at the same time. To create a preset from code, one should first implement CTools hook_ctools_plugin_api(). This example should work for 95% of use cases:
function hook_ctools_plugin_api($owner, $api) {
if ($owner == 'media_derivatives'&& $api == 'media_derivatives_presets') {
return array('version' => 1);
}
}
hook_media_derivatives_presets() should be implemented to actually create one or more configuration presets. Function should return an array with preset objects as it's items. Here is an example of exported presetMedia HTML5 video feature (preset + formatter). There is also API reference availible.
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion