Custom Formatters

This module lets you take the input from a field and allows using HTML and token replacement (or alternately PHP) for display.

For example, to embed youtube videos, add a text field called youtube ID. For the youtube video https://www.youtube.com/watch?v=IU-CMRz-BtE, the ID would be IU-CMRz-BtE. In the custom formatter settings, you would get that ID as a token and place it in the <iframe> embed code that youtube gives like this:

<iframe width="420" height="315" src="//www.youtube.com/embed/[node:field_youtube_id]" frameborder="0" allowfullscreen></iframe>

Here's a nice breakdown: http://www.ostraining.com/blog/drupal/custom-formatters/

Tags

External References

Article Type

Drupal Module: Specialty