You are here

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).

File

templates/gdoc-field.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the Embedded Google Documents Viewer field formatter.
  5. *
  6. * Available variables:
  7. * - url: The publicly accessible url at which the embedded document may be reached.
  8. * - filename: The original file name of the embedded document.
  9. * - delta: The ordinal value of an embedded field. Useful when there is more than one
  10. * document file included in the field.
  11. * - entity: The entity type of the entity containing the file field being formatted (e.g. node).
  12. * - bundle: The bundle type of the entity conating the file field (e.g. page).
  13. * - field_name: The machine_name of the field.
  14. * - field_type: The field type of the field (i.e. file).
  15. *
  16. * @ingroup themeable
  17. */
  18. #}
  19. <iframe class="gdoc-field" src="https://docs.google.com/gview?embedded=true&url={{ url }}"></iframe>
  20. <div class="gdoc-filename"><a href="{{ url }}">{{ filename }}</a></div>