You are here

rdf-metadata.html.twig in Drupal 10

Theme override for empty spans with RDF attributes.

The XHTML+RDFa doctype allows either <span></span> or <span /> syntax to be used, but for maximum browser compatibility, W3C recommends the former when serving pages using the text/html media type, see http://www.w3.org/TR/xhtml1/#C_3.

Available variables:

  • metadata: Each item within corresponds to its own set of attributes, and therefore, needs its own 'attributes' element.

File

core/themes/starterkit_theme/templates/misc/rdf-metadata.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override for empty spans with RDF attributes.
  5. *
  6. * The XHTML+RDFa doctype allows either <span></span> or <span /> syntax to
  7. * be used, but for maximum browser compatibility, W3C recommends the
  8. * former when serving pages using the text/html media type, see
  9. * http://www.w3.org/TR/xhtml1/#C_3.
  10. *
  11. * Available variables:
  12. * - metadata: Each item within corresponds to its own set of attributes,
  13. * and therefore, needs its own 'attributes' element.
  14. *
  15. * @see template_preprocess_rdf_metadata()
  16. */
  17. #}
  18. {% for attributes in metadata %}
  19. <span{{ attributes.addClass('rdf-meta', 'hidden') }}></span>
  20. {% endfor %}