Home Forums Particles Support Timeline Joomla – How to display only start year and end year

Viewing 6 posts - 1 through 6 (of 6 total)

  • Andre Weckeiser
    Subscriber

    Hi,

    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 – today

    How do I configure this?


    Tony
    Moderator

    Hi 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


    Tony
    Moderator
    This reply has been marked as private, meaning that only the original poster and forum moderators can see the content of the reply.

    Andre Weckeiser
    Subscriber

    That’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/blank

    the 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 Weckeiser
    Subscriber

    the second “start year” in the sentence should mean “end year”…sorry 😉


    Tony
    Moderator

    It’s not possible, please note the articles are dynamic based from Joomla categories.
    Thank you

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

80+ templates updated for Joomla 5.1.4 and JoomLead particles 2.3.0 Download
Flash Sale. Get Up to 25% Off - Coupon: FLASH25 Shop Now