block

Query Block With T2 Featured Post Template

Repo Release Link Client Features Developer
repo 16/12-24 link VFB archiveBlock VariationfeaturedContentinnerBlocksqueryt2 Jørgen Stenshaugen

Functionality

A query block variation using the T2 Featured Post template inside the post template block. This allows us to create advanced, flexible and customizable archive blocks. The variation of the query blocks allows us to control what the editors are allowed to use to manipulate the query.

More info on how to customize the query variation here: https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/extending-the-query-loop-block/

Editor

At the moment, T2 featured layout is missing some customizations that the query block offers. It can look a bit intimidating and it’s a advanced block. However, we get the ability to filter based on custom taxonomies, whether it should be a list view or grid view. How many posts we want, offset and max pages to show.

With the query block, we are also allowed to customize the pagination and the no result block. For example, we could chose to display a link to a “read more” page instead of a pagination.

As for the no results block, it allows for innerblocks so if the query ends up with no results we could add any content there, like images, text or even a second query block showing a different post type.

Notes

Not sure what the plans are for T2 Featured Layout is, but the query block offers some stuff I wish T2 Featured Layout currently don’t have. But a downside with the query block that T2 Featured Layout have is that you can mix query and selected featured posts. With the query block, you’re locked to follow the query unless you append those block in the query which isn’t really as UI friendly as featured layout.