Query Loop and u3a plugins (advanced)
The SiteWorks team get more questions on the ‘Query Loop’ Block than any other content editing topic.
The first thing to say is your site does not need to use Query Loops. Site Builder has no equivalent. If your site is relatively small then the case for a Query Loop is not at all compelling. SiteWorks provides u3a tailored features that overlap with Query Loop functionality that are easier to get started with and meet most needs.
Query Loops can certainly be added later. For larger u3as with many active Groups there can be advantages as discussed below.
How to construct a Query Loop is well documented in the Workbook and User Guide. The article is taking the approach of describing what it can do in the u3a context and why SiteWorks specific features will often be better and easier to master. Reading on will be most useful to those who have tried out the u3a widgets (u3a event list etc.).
SiteWorks features that overlap with the Query Loop
u3a events list
A u3a Event has never been defined but as we are familiar with Groups then an Event could be interpreted as a Group all u3a members are joined to and has no specific leader/convenor. It is also a Group that has no specific subject. Examples are Monthly meetings of course and could include a Christmas gathering or simply a one-off opportunity such as an offer to the whole u3a of attending a concert rehearsal. It could also be something outside the u3a – a local town fete perhaps.
The bottom line is using the dashboard menu item ‘u3a Events’ to setup and manage events and to display them using the widget ‘u3a events list’ generally meets the need of most sites and is an order of magnitude easier than configuring a Query Loop.
u3a notice list
These work in a similar way to events. Create and manage the content in the ‘u3a Notices’ list and display using the ‘u3a notice’ widget or shortcode. Again quick and simple to setup.
u3a group list
Displaying Group information follows the same pattern as Events and Notices. Manage the Groups pages with ‘u3a Groups’ and display essentially an extended index of the Groups using ‘u3a Group list’.
There is, however, a key difference here in that this is a static display. While Events and Notices will be sorted by their given date (with expired entries not shown), Groups are typically listed alphabetically, by venue, day meeting day or subject category.
This means if a Group leader wishes to make an announcement they need to arrange for a u3a Notice or u3a Event to be created.
Where does this leave the Query Loop?
In the context of events, notices and groups there is a potential niche when they offer more functionality. Specifically:
- Entries can be listed in multiple columns.
- There is more control over layout and what can be is included or excluded. For example the image could go on the right.
- Additional attributes, such as ‘Organiser’, ‘Cost’ and ‘Booking’ are available through (MFB) Meta Field block. More on these attributes in this article.
- The maximum number of words shown in the extract can be set.
- Rather than limiting the number of entries, or having scores of entries filling the page, pagination is available (Previous Page, Next Page).
There are still limitations. Some filtering is current beyond the u3a plugins and a Query Loop. One example is filtering Groups e.g. suppressing inactive ones.
Currently u3a venue list is not implemented but a Query Loop can be used to list venues in combination with meta fields. See below for an example.
The Query Loop beyond u3a features
A Query Loop can pull from sources other than Groups, Events, Venues and Contacts. One of these is the WordPress Post which, from a SiteWorks perspective, is just a Page that can have a Category and one or more tags associated with it.
The Category can be anything. For example ‘Treasurer reports’, ‘Group Announcements’, but note these are separate to the categories created for u3a plugins. Tags are a bit like social media hash-tags and could be ‘social’, ‘dining’, ‘committee’.
A Query Loop can list Post page summaries and filter on Category (confusingly called Taxonomy on the Query Loop filer) and/or Tags.
Query Loop against WordPress Posts
Take an example. A larger u3a having many Groups have leaders active on SiteWorks wishing to highlight Group announcements. The Web Manager wants to manage u3a notices on behalf of the Committee and avoid overloading ‘u3a notices’.
WordPress Posts offers an alternative for Group leaders to create announcements in their own space which would be listed separately, perhaps on a ‘Groups News’ page. An ‘announcement’ could also be a write up of a group activity such as a recent visit.
For example, the Book Group leader could create a ‘Post’ to advertise that a space for a member has become available. The Post would have the category ‘Group Announcements’[1]. Once a new member is found the ‘Post’ could be deleted.
These Posts would not be linked into the menu structure, they would only be read through the link generated by the Query Loop.
[1] Plan categories carefully. Consider a convention for individual Groups, perhaps BR_Group, or just BR, for Bridge and WA_Group or WA for Wine Appreciation.
Query Loop for u3a venues
Below show a query loop that displays all the attributes of all the venues in a demo version of SiteWorks.
The left panel is the ‘hamburger’ menu view of the Query Loop and component blocks.
Note on the right panel the POST TYPE is ‘Venue’
Revision History
Version | Date | Author | Change summary |
1 | 2024-05-11 | Graham Tigg | First version |
2 | 2024-11-21 | Graham Tigg | Added meta fields and venues |