Loop Grid - Loop Template per Post Term #30403
antoanst
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Prerequisites
What problem is your feature request going to solve? Please describe..
Creating unique layouts for different terms of a post is difficult using the current Loop Grid.
An example - a post type called "Events" with two categories - "Upcoming" and "Past". The post has a few custom fields, one of which is a URL for a "Sign up" button. Currently, one would create a Loop Template for the "Upcoming" state where all custom fields are displayed, including a button loading the URL custom field. Afterwards, in order to properly display "Past" events, one would have to hide the "Sign-up" button by using CSS display:none;.
Adding the option to use separate Loop Templates for selected terms will resolve this and open more possibilities for creating multiple "states" of a post item.
Describe the solution you'd like.
I propose merging the "Layout", "Alternative Template" and "Query" sections from the current Loop Grid widget in the following way:
Source (post types dropdown)
Layouts (repeater element)
Template 1
Choose template type, Choose a template (same as Layout)
Include by / Exclude by (same as Query)
Date, Order By, Order, Query ID (same as Query)
Column Span, Position in grid, Apply once, Static item position (same as Alternative Templates)
(some of the above might have to be disabled if only one Template is being used)
Add item
Columns (unchanged)
Items Per Page (unchanged)
Describe alternatives you've considered.
I've given a simple example workaround in the problem description. Unfortunately, the workaround forces the site viewer to download all elements of a Loop, even though some might be missing dynamic data or be hidden with CSS based on the Loop's terms. It also limits creativity, as different states of a post have to follow a similar layout.
For example, if you have a post type "Exercises" with categories "Yoga" and "Crossfit", and would like to display images for "Yoga" and videos for "Crossfit", you still end up making a single Loop Template and applying workarounds instead of the more efficient setup of making two unique Loop Templates (and two unique ACF Field Groups) that load through the same Loop Grid, but display different content based on the post's terms.
Additional context
No response
Agreement
Beta Was this translation helpful? Give feedback.
All reactions