Getting related post • Various scenarios with ACF & Toolset

Hi all,

I have been using Toolset for several years now and it’s failry extensive in what you can do with it, once you get down into the weeds with its documentation.

I have the following site which presents my fine fine art prints, catalogued by year:
https://www.vaughanprint.com.

It is built using Divi but I am considering re-themeing it with Bricks. So, an oppertunity to tidy things up using the query loop and possibly migrating to ACF. So far I am getting mixed results. Some of the simpler loops work fine. But trying to replicate some of the finer configured loops, filtered based on the relationships are a bit of a hudle, some success with ACF but other scenarios more easily achieved via Toolset views and templates rendered by droping in shortcodes.

A quick overview.

This uses two CPTs, Prints and Print Years. It is using a Toolset relationship with the slug print-year_print.

For the Print Year post type I have template that renders like so:

The top view shows a grid of thumbnails for the work made in that year/period. All very straigh forword to set up in a toolset view. Replicated no problem with ACF, but with the advantage of being able to do so directly in Bricks because the relationships based on the relationshop fields get registered in Bricks.

Moving onto the template created for the Print type.

All very standard stuff here in terms of dynamic data and layout. If you scroll down the page there is another view, much like the one that was on the parent year. Here is where it gets a bit trickier and I had to go in and revisit the original implementation of this, as configured with Toolset. There werre too hoops here. After building out the original view of prints, filtered on the relationship to the parent year. it must be palsed in a Toolset template if it is to render at all. Because this filtered presentation of related (by year) is now on a sibling post the implementation needs an extra step to point back to the parent for reference. This is done by modifying the shortcode:

[wpv-view name=“year-prints”] adding in item=“@print-year_print.parent” to end up with

[wpv-view item=“@print-year_print.parent” name=“year-prints”]

This does the trick. It requires a deep knowledge of Toolset developer documentatoin (or help from support), but once you know how to do this it’s fairly straight forward. I’m not seeing anyway to do this in ACF Pro. There are some posts online demonstrating how to do this with PHP but none showing a Bricks/ACF approach to this?

There is the following example showing how this can be done using the query editor (PHP) but it doesn’t give the results I need.

Applied on the Year template it outputs more prints not in the related year. Applied on the Print template it doesn’t produce any results at all.

If anyone else has had a look at this sort of scenario with some success (Information on ACF or Toolset solutions ), some pointers would be appreciated.

The follwoing documentation is available from Toolset:

I looked through this Toolset documentation but had no look garnering anything from this that would work in the query loop editor(PHP).