gdoc-field.html.twig in Embedded Google Docs Viewer 8
Default theme implementation for the Embedded Google Documents Viewer field formatter.
Available variables:
- url: The publicly accessible url at which the embedded document may be reached.
- filename: The original file name of the embedded document.
- delta: The ordinal value of an embedded field. Useful when there is more than one document file included in the field.
- entity: The entity type of the entity containing the file field being formatted (e.g. node).
- bundle: The bundle type of the entity conating the file field (e.g. page).
- field_name: The machine_name of the field.
- field_type: The field type of the field (i.e. file).
1 theme call to gdoc-field.html.twig
- GdocFieldFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ GdocFieldFormatter.php - Builds a renderable array for a field value.
File
templates/gdoc-field.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for the Embedded Google Documents Viewer field formatter.
- *
- * Available variables:
- * - url: The publicly accessible url at which the embedded document may be reached.
- * - filename: The original file name of the embedded document.
- * - delta: The ordinal value of an embedded field. Useful when there is more than one
- * document file included in the field.
- * - entity: The entity type of the entity containing the file field being formatted (e.g. node).
- * - bundle: The bundle type of the entity conating the file field (e.g. page).
- * - field_name: The machine_name of the field.
- * - field_type: The field type of the field (i.e. file).
- *
- * @ingroup themeable
- */
- #}
- <iframe class="gdoc-field" src="https://docs.google.com/gview?embedded=true&url={{ url }}"></iframe>
- <div class="gdoc-filename"><a href="{{ url }}">{{ filename }}</a></div>