You are here

bibcite-reference--table.html.twig in Bibliography & Citation 2.0.x

Same filename and directory in other branches
  1. 8 modules/bibcite_entity/templates/bibcite-reference--table.html.twig

bibcite-reference-table.html.twig Theme implementation to present Reference data in table.

Available variables:

  • title_prefix: Additional output populated by modules, intended to be displayed in front of the main title tag that appears in the template.
  • title_suffix: Additional output populated by modules, intended to be displayed after the main title tag that appears in the template.
  • content: All reference items. Use {{ content }} to print them all, or print a subset such as {{ content.field_example }}. Use {{ content|without('field_example') }} to temporarily suppress the printing of a given child element.
  • attributes: HTML attributes for the container element.
  • bibcite_reference: The bibcite_reference entity with limited access to object properties and methods.
  • view_mode: View mode; for example, "teaser" or "full".
  • rows: Data rows.

See also

template_preprocess_bibcite_reference_table()

File

modules/bibcite_entity/templates/bibcite-reference--table.html.twig
View source
  1. {#
  2. /**
  3. * @file bibcite-reference-table.html.twig
  4. * Theme implementation to present Reference data in table.
  5. *
  6. * Available variables:
  7. * - title_prefix: Additional output populated by modules, intended to be
  8. * displayed in front of the main title tag that appears in the template.
  9. * - title_suffix: Additional output populated by modules, intended to be
  10. * displayed after the main title tag that appears in the template.
  11. * - content: All reference items. Use {{ content }} to print them all,
  12. * or print a subset such as {{ content.field_example }}. Use
  13. * {{ content|without('field_example') }} to temporarily suppress the printing
  14. * of a given child element.
  15. * - attributes: HTML attributes for the container element.
  16. * - bibcite_reference: The bibcite_reference entity with limited access to object properties and methods.
  17. * - view_mode: View mode; for example, "teaser" or "full".
  18. * - rows: Data rows.
  19. *
  20. * @see template_preprocess_bibcite_reference_table()
  21. *
  22. * @ingroup themeable
  23. */
  24. #}
  25. <div{{ attributes }}>
  26. {{ title_prefix }}
  27. {{ title_suffix }}
  28. <table>
  29. {% if rows %}
  30. <tbody>
  31. {% for row in rows %}
  32. {% set row_classes = [
  33. not no_striping ? cycle(['odd', 'even'], loop.index0),
  34. ] %}
  35. <tr{{ row.attributes.addClass(row_classes) }}>
  36. <td>{{- row.title -}}</td>
  37. <td>{{- row.element -}}</td>
  38. </tr>
  39. {% endfor %}
  40. </tbody>
  41. {% endif %}
  42. </table>
  43. </div>