Forum

Thread tagged as: Question

Event day

I would like to add a heading in the event-day.html that should be displayed only for the first event (date) of each month. Your help is much appreciated!

Martin Stettler

Martin Stettler 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What is your event-day.html template doing? How is it displayed?

If you're using the example templates, there's at least two with that name.

It is customized, have a look please:

<div class="row row-centered act">
    <div class="col-sm-6 col-sm-offset-3">
        <div class="act-inside">
            <h2><perch:events id="eventDateTime" format="D, jS F Y" />, <perch:events id="eventDateTime" format="%l:%M %p" />, <perch:events id="eventTitle" /> </h2>
            <div class="description">
                <perch:events id="eventDescHTML" encode="false" />
            </div>
        </div>
    </div>
</div><!-- /.row -->

Many thanks!

Rachel Andrew

Rachel Andrew 394 points
Perch Support

How is this template being displayed?

Here's an example:

  1. line: TUE, 21ST JULY 2015, 20:30 PM, Event name
  2. line: Ticket-Link
  3. line: Event description
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which page function are you using in your page to make use of this template?

It's your event app what I am using. The function is therefore:

<?php perch_events_listing(); ?>

Further used templates: event.html and the calendar.html (customized) Thanks a lot!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you tried checking for the first item?

<perch:if exists="perch_item_first">
<h2><perch:events id="eventDateTime" format="D, jS F Y" />, <perch:events id="eventDateTime" format="%l:%M %p" />, <perch:events id="eventTitle" /> </h2>
</perch:if>

That doesn't help, I need the month as a title for each first date of a new month... E.g. July (= title) then several July-events listed, then August (= title) then several August-events and so on...

Drew McLellan

Drew McLellan 2638 points
Perch Support

Then try:

<perch:if different="eventDateTime" format="Y-m">
... heading ...
</perch:if>

Ok, it works: the heading is doing right, thank you! (...but there is still another date problem, i open a new post)