Posts block type upgraded

Today work was done on the Posts block type. This is the default or most common block ACF Engine offers for listing posts. There is also a Post Table block which renders posts in a table which is useful for editing and other purposes. For display however, a CSS grid is most often the best choice. This is the output from the post block type, a grid with a column template, gap settings.

Today we added a useful feature that we found was really missing during our tests on a real project. That is the creation of an “edit link” for each item shown in the grid. We didn’t stop at edit links for the post items, we also added an edit link for the entire loop item template. So this saves having to constantly return to the WP Admin then go through to the ACF Engine menu to the templates list and then pick the correct item to edit. Just by the way that sentence reads you can see why that process gets annoying when you’re in the building process on a project and you’re tweaking the item template at the same time that you’re adding posts. It’s too much bouncing around to different locations. With this approach you can keep the post list page (the page with the posts block) open, then usually open your edit links in a new tab. Do your edits, close the tab and just refresh the working page. I like to “pin” the working page in my browser to avoid it being closed, then open in new tab the edit links. This way I’m able to quickly edit posts and make any changes needed to the item template as well.

For those unfamiliar with ACF Engine’s template features, the “Item Template” is a Gutenberg block template used to display 1 item in a loop. Under the ACF Engine > Templates these are categorized as “Loop Templates”. Like other dynamic loop blocks, the Post Block Type takes a query (to fetch the posts you want to display) and an Item Template which is used to display each item in a loop. All the dynamic blocks work in this loop template, such as ACF Field, ACF Field Number, ACF Field Image etc.

Leave a Reply