Advertising sustains the DA. Ads are hidden for members. Join today

How to change the render of an atom

Last updated on
30 April 2025

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->player in 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 alt or title, or to use HTML5 tags like figure and figcaption.

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

Page status: Not set

You can: