You are here

calendar-item.html.twig in Calendar 8

Template to display view fields as a calendar item.

  • item A result object for this calendar item. Note this is not a complete entity. It will contain various values as added by the row plugin, which may depend on the entity type.
  • rendered_fields An array of the rendered html for the fields in the item, as generated by Views. This does not include excluded fields and should take into account any special processing added in the field settings.

Calendar info for this individual calendar item is in local time -- the user timezone where configurable timezones are allowed and set, otherwise the site timezone. If this item has extends over more than one day, it has been broken apart into separate items for each calendar date and calendar_start will be no earlier than the start of the current day and calendar_end will be no later than the end of the current day.

  • calendar_start - A formatted datetime start date for this item. i.e. '2008-05-12 05:26:15'.
  • calendar_end - A formatted datetime end date for this item, the same as the start date except for fields that have from/to fields defined, like Date module dates.
  • calendar_start_date - a PHP date object for the start time.
  • calendar_end_date - a PHP date object for the end time.

See also

template_preprocess_calendar_item.

File

templates/calendar-item.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template to display view fields as a calendar item.
  5. *
  6. * - item
  7. * A result object for this calendar item. Note this is
  8. * not a complete entity. It will contain various
  9. * values as added by the row plugin, which may depend
  10. * on the entity type.
  11. *
  12. * - rendered_fields
  13. * An array of the rendered html for the fields in the item,
  14. * as generated by Views. This does not include excluded
  15. * fields and should take into account any special processing
  16. * added in the field settings.
  17. *
  18. * Calendar info for this individual calendar item is in local time --
  19. * the user timezone where configurable timezones are allowed and set,
  20. * otherwise the site timezone. If this item has extends over more than
  21. * one day, it has been broken apart into separate items for each calendar
  22. * date and calendar_start will be no earlier than the start of
  23. * the current day and calendar_end will be no later than the end
  24. * of the current day.
  25. *
  26. * - calendar_start - A formatted datetime start date for this item.
  27. * i.e. '2008-05-12 05:26:15'.
  28. * - calendar_end - A formatted datetime end date for this item,
  29. * the same as the start date except for fields that have from/to
  30. * fields defined, like Date module dates.
  31. * - calendar_start_date - a PHP date object for the start time.
  32. * - calendar_end_date - a PHP date object for the end time.
  33. *
  34. * @see template_preprocess_calendar_item.
  35. */
  36. #}
  37. <div class="{{ item.class|default('item') }}">
  38. <div class="view-item">
  39. <div class="calendar {{ item.granularity }}view">
  40. {{ item | calendar_stripe }}
  41. <div class="{{ item.date_id }} contents">
  42. {% for field in rendered_fields %}
  43. {% if (index + 1) == 0 and item.continuation %}
  44. <div class="continuation">&laquo;</div>
  45. {% endif %}
  46. {% for field_html in field %}
  47. {{ field_html }}
  48. {% endfor %}
  49. {% endfor %}
  50. </div>
  51. {% if item.continues %}
  52. <div class="continues">&raquo;</div>
  53. {% else %}
  54. <div class="cutoff">&nbsp;</div>
  55. {% endif %}
  56. </div>
  57. </div>
  58. </div>