Forum

Thread tagged as: Question, Problem, Events

Event categories | How are they different?

Hi!

I’m having trouble with the event categories.

Question 1: Difference between events and content/blog

First of all: Why are they not a category-set, like blog or content categories are?

I set up four event categories. On my event home page and event category page, I display the categories, with links to the corresponding category page.

templates/pages/events/events-index.php

    // Secondary navigation
    perch_events_categories(array(
        'template' => 'nav--events.html'
    ));

templates/events/nav--events.html

<perch:before>
<div class="o-wrapper o-wrapper--wide">
    <nav class="c-nav--second">
        <ul class="c-nav--second__list">
            <li class="c-nav--second__item"><a class="c-nav--second__link" href="/weiterbildung">Alle Weiterbildungen</a></li>
</perch:before>

            <li class="c-nav--second__item">
                <a class="c-nav--second__link" href="/weiterbildung/<perch:events id="categorySlug" />"><perch:events id="categoryTitle" /></a>
            </li>

<perch:after>
        </ul>
    </nav>
</div>
</perch:after>

Question 2: Re-ordering

I cannot re-order the event categories in Perch, they are displayed alphabetically in the backend and frontend. So my „Events“ category is always displayed before my „Seminars“ category in the navigation above, even though the Seminars should go first. Is there a way to accomplish that?

Question 3: Additional fields

I also added a categoryTitleSingular text-field so I can give the „Seminars“ a „Seminar“ singular to output in context. The only way I achieved this was like the following, which would not work if the editor added more categories, because it’s hard-coded into the template. How can I achieve the same for extended use and editor-added categories?

templates/events/category.html

<perch:events id="categoryTitle" type="text" />
<perch:events id="categoryTitleSingular" label="Einzahl" type="text" />
<perch:events id="catDesc" type="textarea" label="Beschreibung der Kategorie" size="s" help="Wird in den jeweiligen Weiterbildungs-Listen angezeigt" />

templates/events/listing/event-detail.html

<perch:if exists="seminare"><span class="c-event__detail__category">Seminar</span></perch:if>
  <perch:if exists="lehrgange"><span class="c-event__detail__category">Lehrgang</span></perch:if>
  <perch:if exists="studiengang-verpflegungsbetriebswirt"><span class="c-event__detail__category">Studiengang</span></perch:if>
  <perch:if exists="events"><span class="c-event__detail__category">Event</span></perch:if>
Jannis Borgers

Jannis Borgers 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The difference is that the Events app is much older and so hasn't been updated yet to use the centralised categories system.

Some of the functionality you're looking for isn't available as the app is so old.

Thanks for the reply, Drew!

Is it possible to achieve everything that the Events app can do with Runway collections? I don’t see how using collections with the centralised categories would give me a disadvantage (apart from the calendar listing, which I don’t use), but I might be wrong.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Everything apart from the calendar display, yes.