Arlo home

Online Activity List related shortcodes

These shortcodes build the list of online activities. A page that contains [arlo_onlineactivites_list] is filled with the Online activities list template, and that template is made from filter dropdowns, a list item that repeats for each online activity, and page links.

The details of each online activity are output by the shortcodes in Online Activity related shortcodes, which you put inside the list item. Which online activities are listed is set by the attributes of the page shortcode and the page filters on the Pages tab, not by the shortcodes here.

The HTML shown for each shortcode is what the plugin outputs, with line breaks and indentation added for readability. Names and URLs are examples. The spelling onlineactivites (without the second "i") is the real shortcode name.

Contents

Quick start

A minimal Online activities list template:

[arlo_onlineactivites_filters]
<ul class="arlo-online-activities">
[arlo_onlineactivites_list_item limit="10" group="category"]
    [arlo_group_divider wrap="<li class='divider'><h2>%s</h2></li>"]
    <li>
        [arlo_event_template_permalink wrap="<a href='%s'>"][arlo_oa_name]</a>
        [arlo_oa_offers]
        [arlo_oa_registration]
    </li>
    [arlo_oa_rich_snippet]
[/arlo_onlineactivites_list_item]
</ul>
[arlo_onlineactivites_list_pagination limit="10" wrap="<div class='pagination'>%s</div>"]

Rendered as HTML, for two categories on page 1 of 2:

<form class="arlo-filters" method="get" action="https://example.com/online-activities/">…</form>
<ul class="arlo-online-activities">
  <li class="divider"><h2>Leadership</h2></li>
  <li>
    <a href="https://example.com/events/101-reporting-essentials/">Reporting Essentials</a>
    <ul class="arlo-list arlo-event-offers">…</ul>
    <div class="arlo-oa-registration">…</div>
  </li>
  <script type="application/ld+json">{"@type":"OnDemandEvent",…}</script>
  <li class="divider"><h2>Coaching</h2></li>
  <li>…</li>
  <script type="application/ld+json">{"@type":"OnDemandEvent",…}</script>
  <script type="application/ld+json">{"@type":"ItemList",…}</script>
</ul>
<div class="pagination">
  <span aria-current="page" class="page-numbers current">1</span>
  <a class="page-numbers" href="https://example.com/online-activities/page/2/">2</a>
  <a class="next page-numbers" href="https://example.com/online-activities/page/2/">Next &raquo;</a>
</div>

[arlo_onlineactivites_list_item]

Repeats the content between its tags once for each online activity in the list. It can group the online activities with dividers and limit how many are shown per page.

Type: Enclosing. Put your markup and other shortcodes between [arlo_onlineactivites_list_item] and [/arlo_onlineactivites_list_item].
Use in: the Online activities list template.

Structure

[arlo_onlineactivites_list_item
    limit="10"
    group="category"
    noevent_before="<div class='not-found'>"
    noevent_after="</div>"]
    [arlo_group_divider wrap="<li class='divider'>%s</li>"]
    <li>[arlo_oa_name]</li>
[/arlo_onlineactivites_list_item]

Output (example)

Rendered as HTML, for online activities in two categories (put the <ul> around the shortcode in your template):

<li class="divider">Leadership</li>
<li>Reporting Essentials</li>
<li class="divider">Coaching</li>
<li>Collaboration Across Borders</li>
<li>Remote Workshop Toolkit</li>
<script type="application/ld+json">{"@type":"ItemList","itemListElement":[{"@type":"ListItem","position":1,"url":"…"},…]}</script>

Usage

Repeat group="none" on the pagination

If you use group="none" here, set it on [arlo_onlineactivites_list_pagination] too, or the page count will not match the list.

  • The shortcode adds no wrapper element of its own, only your markup and a JSON-LD ItemList <script> after the last online activity.
  • Inside it you can use the [arlo_oa_…] shortcodes, the [arlo_event_template_…] shortcodes for the event template of the online activity (such as [arlo_event_template_permalink] for its page), and [arlo_group_divider].
  • Without group="none", an online activity that is in several categories is listed once for each category.
  • When no online activity matches, the shortcode outputs a message, not nothing (see noevent_before).

Attributes

AttributeType / valuesDefaultDescription
Paging
limit Integer, 1 or more The WordPress Posts per page setting Online activities per page.
Grouping
group Option:
  • category Divider for each category, with the category name
  • alpha Divider for each first letter of the online activity name
  • none No dividers; each online activity is listed once (Since 5.1.0)
Not set Makes the divider text available to [arlo_group_divider], on the first online activity of each group. Without it the list is ordered by event template name.
No results
noevent_before HTML as allowed in a WordPress post None Output before the "no results" message. Since 5.1.0.
noevent_after HTML as allowed in a WordPress post None Output after the "no results" message. Since 5.1.0.

Also accepts the universal attributes, which apply to the whole list. The message when nothing matches is <p class="arlo-no-results"> with the "No events to show" text setting, or "No online activities to show" when that setting is empty. Category and tag filters are set on the page shortcode [arlo_onlineactivites_list] or on the Pages tab.

Examples

No grouping, each online activity listed once, with a message of your own when nothing matches. The pagination repeats group="none":

<ul>
[arlo_onlineactivites_list_item limit="6" group="none" noevent_before="<div class='not-found'>" noevent_after="<a href='/contact/'>Contact us</a></div>"]
    <li>[arlo_oa_name]</li>
[/arlo_onlineactivites_list_item]
</ul>
[arlo_onlineactivites_list_pagination limit="6" group="none"]
<ul>
  <li>Collaboration Across Borders</li>
  <li>Product Discovery Primer</li>
  <li>Remote Workshop Toolkit</li>
  <li>Reporting Essentials</li>
  <script type="application/ld+json">{"@type":"ItemList",…}</script>
</ul>

When nothing matches, the message is output between your before and after markup:

<div class="not-found"><p class="arlo-no-results">No online activities to show</p><a href="/contact/">Contact us</a></div>

Alphabetical grouping marks the first online activity of each letter:

[arlo_onlineactivites_list_item limit="50" group="alpha"]
    [arlo_group_divider wrap="<h2>%s</h2>"]
    <p>[arlo_oa_name]</p>
[/arlo_onlineactivites_list_item]
<h2>C</h2>
<p>Collaboration Across Borders</p>
<h2>P</h2>
<p>Product Discovery Primer</p>
<h2>R</h2>
<p>Remote Workshop Toolkit</p>
<p>Reporting Essentials</p>
<script type="application/ld+json">{"@type":"ItemList",…}</script>

[arlo_onlineactivites_filters]

Outputs a form with filter dropdowns for the list, and a link that resets the filters.

Use in: the Online activities list template, usually before [arlo_onlineactivites_list_item].

Structure

[arlo_onlineactivites_filters filters="templatetag,category" resettext="Clear filters" buttonclass="button"]

Output (example)

Rendered as HTML (the options are shortened):

<form class="arlo-filters" method="get" action="https://example.com/online-activities/">
  <select aria-label="Template Tags" id="arlo-filter-templatetag" class="arlo-filter-templatetag" name="arlo-templatetag">
    <option value="">Select tag</option><option value="Data">Data</option>…
  </select>
  <select aria-label="Categories" id="arlo-filter-category" class="arlo-filter-category" name="arlo-category">
    <option value="">All categories</option><option value="11-leadership">Leadership</option>…
  </select>
  <div class="arlo-filters-buttons">
    <input type="hidden" id="arlo-page" value="https://example.com/online-activities/">
    <a href="https://example.com/online-activities/" class="button">Clear filters</a>
  </div>
</form>

Usage

  • With no attributes, only the category dropdown is shown. Dropdowns appear in the order given in filters.
  • The reset link goes to the online activities list page.

Attributes

AttributeType / valuesDefaultDescription
filters Comma-separated list of: categorytemplatetag category The dropdowns to show: the categories (nested) and the tags of the event templates.
resettext Text Reset The text of the reset link.
buttonclass Text; CSS class names button The CSS class of the reset link.

Also accepts the universal attributes.

[arlo_onlineactivites_list_pagination]

Outputs the page links for the list. Nothing is output when everything fits on one page.

Use in: the Online activities list template, after [arlo_onlineactivites_list_item].

Structure

[arlo_onlineactivites_list_pagination limit="10" wrap="<div class='pagination'>%s</div>"]

Output (example)

Rendered as HTML, on page 1 of 3:

<div class="pagination"><span aria-current="page" class="page-numbers current">1</span>
<a class="page-numbers" href="https://example.com/online-activities/page/2/">2</a>
<a class="page-numbers" href="https://example.com/online-activities/page/3/">3</a>
<a class="next page-numbers" href="https://example.com/online-activities/page/2/">Next &raquo;</a></div>

Usage

  • Place it after the list item. It then uses the list item's limit, and counts the same online activities.
  • The links use WordPress paging, /page/2/ with pretty permalinks.
  • Use wrap for any surrounding element, so it is left out when there is only one page.
  • If the list item has group="none", set group="none" here too.

Attributes

AttributeType / valuesDefaultDescription
limit Integer, 1 or more The list item's limit, otherwise the WordPress Posts per page setting Online activities per page.
group Option: none Not set Set to none when the list item uses it.

Also accepts the universal attributes; wrap is used in the example above.