Access to acf object page link in double looper

Hello,

In ACF fields I have a repeater with a couple of fields and an additional repeater field for the button element.

In that additional repeater, there are two fields. Text and object with return format object so I can select page.

In Cornerstone, the row element is the looper provider and the column element is the looper consumer. Inside that column, I did set up a div element for the button. The div element is the looper provider with the looper key of the second repeater. On the button element, I’m calling the text field that displays the correct value, but inside the link button option when I put {{dc:post:permalink}} return is web URL and not URL of the selected page.

How to get link of the selected page?

Hello Ofir,

Thanks for writing in!

You can use {{dc:post:permalink depth="1"}}. Check out the depth attribute in this documentation:

Kindly let us know how it goes.

Hello,

this suggestion didn’t change the permalink.

Best regards

Hey Ofir,

We would love to check your Looper Structure. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Hello,

I put all details in secure note.

Best regards

Hello Ofir,

Your Looper structure is incorrect. You need something like this:

Row element - Looper Provider Dynamic Content `{{dc:acf:post_field field="zasebna_usluga"}}`
    Column - Looper Consumer
        DIV element - Looper Provider Dynamic Content `{{dc:looper:field key="dugme"}}` / Looper Consumer
             DIV element - Looper Provider Dynamic Content `{{dc:looper:field key="odabir_stranice"}}` / Looper Consumer
                    BUTTON element which will have `{{dc:post:permalink}}` for the link and `{{dc:looper:field key="tekst_dugmeta" depth="1"}}` for the Button Text
   

Hope this makes sense.

Hello,

sorry for the late reply. This makes sense. Thank you.

But how to replicate this if parent field is repeater? Can you also please check under Distribucija page?

Hello Ofir,

You should be setting them up in the same order.

Check out the page that serves as the demo.

Thanks.

Edit: I managed to get link on image, but now only first image shows from content repeater. And if I remove consumer from second repeater than all images are displayed but without link on them.

Can you please check that?

Hey Ofir,

Your ACF field is a bit complicated. You can simplify it this way:

Distribucija: Repeater
    Naziv sekcije: Text
    Logotipi: Repeater
       Logo: Image
       Logotip link: URL

You do not need a repeater for a logo link because you only need one URL for each logo.

Best Regards.

Hi again,

thank you very much. Now I see that the real problem was my ACF setup.

You can close this topic.

Best regards

Hi Ofir,

Glad that we are able to help you.

Thanks