How to get current registration values in node template

Created on 15 April 2025, 9 days ago

Is there any way to have a better UX for fully booked events or when end date has been reached? I am thinking of some TWIG code for the parent node like

{% if content.field_registration >> registration end date has been reached %}
<div>Registration has ended</div>
{% endif  %}
{% if content.field_registration >> max space number has been reached %}
<div>We are fully booked</div>
{% endif  %}

(...or is this the wrong place to discuss things like this? Any help is appreciated)

πŸ’¬ Support request
Status

Active

Version

3.4

Component

Miscellaneous

Created by

πŸ‡¨πŸ‡­Switzerland mazze

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mazze
  • πŸ‡¨πŸ‡­Switzerland mazze
  • πŸ‡ΊπŸ‡ΈUnited States john.oltman

    In the latest version of the module 3.4.2 the field formatters have options for showing "reason text" if registration is not available. So you shouldn't require a special template to get some basic text output. See if that helps.

  • πŸ‡¨πŸ‡­Switzerland mazze

    This works perfectly, thank you @john.oltman for adding the feature and for helping. One last question: I could replace the "closed." cause with a more detailed text in the translation interface, is this the recommended way to adapt...?

Production build 0.71.5 2024