• Resolved Rock a Robot!

    (@revilo2020de)


    Hello!

    I’m building an event calendar using ACF. I set up different ACF post types which are related:

    • “event”: title, description, image, location (from CPT “location”), organizer (from CPT “organizer”)
    • “location”: name, address, zip-code, city
    • “organizer”: Name, phone, website, …

    In the single event template Id like to display the event information () along with additional data from the linked “location”, e. g. the address. Is this possible with Blocks for ACF Fields (free or pro version)?

    Thanks for the information,
    Oliver

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author gamaup

    (@gamaup)

    Hi Oliver,

    Yes. This is absolutely possible, but it requires the Pro version of Blocks for ACF Fields.

    In your setup, both location and organizer are ACF Post Object fields attached to the event. With the Pro version, you can load Post Object fields as a loop, even if the field only contains a single item. Inside that loop, you can then display any custom field that belongs to the linked post type. In your case, the address fields from “location” or the phone/website fields from “organizer.”

    I also have a short demo video that shows the exact concept (the example uses the same post type, but the method is identical for your case):
    https://youtu.be/L53j_6ApCh4

    Best,
    Gama

    Thread Starter Rock a Robot!

    (@revilo2020de)

    Dear Gama, many thanks for the quick response and information. That sounds good. I just purchased pro and am looking forward to try. Have a good day!

    Thread Starter Rock a Robot!

    (@revilo2020de)

    Hi Gama,

    I tried to get it running as shown in the video. However, the ACF field-block inside the grid only allows me to choose from “event”-fields, but not from “location”-fields (= the linked post object in the field “) as intended and shown in the video (although there it’s not different Custom Post Type, but the same type as the main post: “movies”).

    Here’s what I did:

    In ACF:

    • Added Custom Post Type “Event” with fields “title” (text), “description” (text) and “location” (post object, filtered to Post type “location”)
    • Added Custom Post Type “location” with fields “name”, “address” and “phone”

    In template “single event”:

    • Added block “ACF field” –> Current Post (= event) / field: location –> show as grid
    • Added another ACF field-block inside the grid, expecting that this would show me the fields available for the linked “location” post object. But it only shows “events”-fields. :-/

    Any help?

    Thanks and Best Regards,
    Oliver

    Plugin Author gamaup

    (@gamaup)

    Hi Oliver,

    Thanks for the detailed explanation, that helps a lot.

    I’ve checked your case on my side, and I found the issue. The block should indeed allow you to load fields from the linked “location” post inside the loop, but something is preventing the field picker from switching to the correct post context.

    I’m working on a fix right now and expect to have it resolved within the next few hours. I’ll let you know as soon as the update is ready.

    Thank you for reporting this, really appreciate it!

    Best regards,
    Gama

    Plugin Author gamaup

    (@gamaup)

    Hi Oliver,

    I’ve just released an update that includes the fix for this issue (v1.2.8). You should now be able to load the custom fields from your linked “location” post inside the loop as intended.

    Since you’re a Pro user, feel free to reach out to me directly anytime at [email protected] if you run into anything else or need help with your setup.

    Thank you for your patience!

    Best regards,
    Gama

    Thread Starter Rock a Robot!

    (@revilo2020de)

    Wow, Gama – that was an impressively fast response time! I just updated the plugin, and it works perfectly now. Great support experience – thank you very much!

    Oliver

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Display Data from different post types?’ is closed to new replies.