Question

Photo of Brian Daneu

0

Event in calander super long

I have a event in the calander that reoccurres about 60 times befor it ends. My problem is that when you click on one of the events in the calander  you get a huge list of the 60 dates this event will occur. Is there a way to tell the block not to show all the dates for that event and only show the date you selected. We’re running 8.3 rock currently.
  • Photo of DJ Grick

    1

    You could change the Lava template for your calendar but it would be a universal change affecting every event with multiple event occurrence. 

  • Photo of Shawn Ross

    1

    Brian, DJ is correct, you can change the Lava template being used. For example, you can see the stock Lava template (CalendarItem.lava) used on the Event Details page on Github here.

    Lines 63-71 I believe are what you're talking about with your question.

     {% assign scheduledDates = EventItemOccurrence.Schedule.iCalendarContent | DatesFromICal:'all' %}
          <strong>Date / Time</strong>
          <ul class="list-unstyled">
            {% for scheduledDate in scheduledDates %}
            <li>
              {{ scheduledDate | Date:'dddd, MMMM d, yyyy @ h:mm tt' }}
            </li>
            {% endfor %}
          </ul>

    A couple lava filters I see available may help in this case:

    • ForLoop
    • The 'Alternate' listed on the above linked For page, using Assign
    • Truncate

    If you can find a way to 'count' the amount of events, you can then essentially truncate how many are shown (maybe using the forloop, maybe using truncate, i'm not sure). This level of customization is currently something I'm not super-familiar with ;)

  • Photo of Dennis OFlynn

    1

    Expanding on @Shawn's comment...  the following limits the event list size to 12

          {% assign scheduledDates = EventItemOccurrence.Schedule.iCalendarContent | DatesFromICal:'all' %}
          <strong>Date / Time</strong>
          <ul class="list-unstyled">
            {% for scheduledDate in scheduledDates %}
                {% if forloop.index > 12 %}
                    <li>...list limited to first 12 items</li>
                    {% break %}
                {% endif %}

            <li>
                {{ scheduledDate | Date:'dddd, MMMM d, yyyy @ h:mm tt' }}
            </li>



  • Photo of Johnny Pierre

    0

    I'm new to Rock and thank God i found this. Just what I was looking for.