Home › Forums › Particles Support › Timeline Joomla – How to display only start year and end year
-
Andre WeckeiserSubscriberHi,
after installing Joomla Timeline into a working Joomla-Gantry-Helium-environment I wonder how you can configure the particle that only a start year and an end year is displayed in the timeline. Without month and day and the day name.
Example: <timeline entry> – 2001 – 2020
or with open end
Example: <timeline entry> – 2001 –
or with “today”
Example: <timeline entry> – 2001 – todayHow do I configure this?
TonyModeratorHi there,
It’s possible but you need to modify and remove the existing date field for timeline items and then define the first/last item using loop.first and loop.last. Example.{% if display.date.enabled %} {% if loop.first %} <div class="tm-timeline-date"{{scrollspy_cls}}> <span class="tm-date{{ date_style }}"><i class="fa fa-calendar-check-o" aria-hidden="true"></i> Start Here </span> </div> {% endif %} {% endif %}
and
{% if loop.last %} <div class="tm-timeline-date jl-text-right"{{scrollspy_cls}}> <span class="tm-date{{ date_style }}"><i class="fa fa-calendar-check-o" aria-hidden="true"></i> End Here </span> </div> {% endif %}
Last, for item switcher on mobile/tablet devices, you can replace the item_date like this
{% set item_date %} {% if loop.first %} <div class="jl-card-badge jl-label{{ img_padding ? ' jl-position-top-right' : '' }}"> Start Here </div> {% endif %} {% if loop.last %} <div class="jl-card-badge jl-label{{ img_padding ? ' jl-position-top-right' : '' }}"> End Here </div> {% endif %} {% endset %}
NOTE: In this case, you need to define the custom text for start and end date. You can define the text fields via jltimelinejoomla.yaml and receive the output via jltimelinejoomla.html.twig
Screenshot: https://imgur.com/kxB4awF
TonyModerator
Andre WeckeiserSubscriberThat’s close to what I want (many thanks!!), but something is missing.
I have a timeline with 10+ entries.
For every single entry I want to show either
start year – end year
or
start year – “today”/no year/blankthe dates for start year could be the date of the article creation and
the dates for the start year could be the date of the article publishing
which I manually change.Is that possible?
Andre WeckeiserSubscriber
TonyModerator
You must be logged in to reply to this topic.