How to change the render of an atom
You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules
When an atom is rendered, it is first transcoded (if possible and necessary), then rendered by a player. A player is configurable per context per atom type. What it does is that in the hook_scald_prerender() it prepares a markup for $atom->rendered->player.
You could prepare/modify that value in two places: as the atom provider or as the player provider.
- For special atom types such as Twitter where the default player cannot do much, you need to prepare the markup in
$atom->rendered->playerin the role of atom provider (cf. Twitter or YouTube modules). - For atom types such as image, a player makes more sense because you can customize your markup, even that of a local file, or a Flickr image, to defined attributes like
altortitle, or to use HTML5 tags likefigureandfigcaption.
To make your own player, simply implement hook_scald_player, configure the context to use your player, then in hook_scald_prerender($mode = 'player') prepare your markup with the transcoded file at $atom->file_transcoded.
Help improve this page
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