Get specific value from acf file array

Hi there,

i made a acf file field. this field is setup to return the value as file-array.
now i get the whole thing (file-name, file url,…)
is it possible to pick one specific thing out of the array?

what i try to do:

Upload a PDF
get File name and show it
get URL for download

i know i can add another acf field with name, but then the customer has to enter the name aswell. i try to find a simple way for the customer.

thanks in advance for your help.

best regards
Harry

Hi Harry,

Thanks for reaching out.
You can use the File field type for a similar purpose, I would suggest you go through the following article explaining the field type.

Hope it helps.
Thanks

hi,

i allready have a file field where i seletced file-array as return!

my question was: can i select a single value from the return string?

because now my string looks like this ({{dc:looper:field key=“pp_test_pdf”}}):

555,555,TEST PDF,TEST-PDF.pdf,195828,https://xxx/wp-content/uploads/TEST-PDF.pdf,https://cr68.com/artisan/test-pdf/,,1,,,test-pdf,inherit,0,2021-10-30 13:59:10,2021-10-30 13:59:10,0,application/pdf,application,pdf,https://xxx/wp-includes/images/media/document.png

but i only need TEST PDF (Name of the pdf) => to show the file name, the url => for linking and the preview png.

i try to build a pdf download area

thanks

Hi @deranaloge,

Would you mind sharing your admin credentials so that we can take a closer look at your setup? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

hi,

of course. i added detials in secue note.

cheers and thank you
harry

hello,

can anyone help me? 2 days without answer is really long…

thanks
harry

Hi Harry,

We’re sorry for the late reply. It takes time for us to get the right dynamic content because it’s a bit complicated in getting the file array. It requires 3 looper providers to get it. Here’s the structure.

  • Looper Provider - ACF Key (Section2)
    – Consumer (Row 1)
    — Looper Provider- Looper Consumer - ACF repeater field ( Column 1)
    ---- Looper Provider - Current Looper item (Row 1.2)
    ----- Column - Consumer (Column 1.2)
    ----- Text

To display the file URL, the dynamic content is {{dc:looper:field key=“url”}} while {{dc:looper:field key=“title”}} is to display the file title and it is based on this documentation.

Hope that helps.

hi!
oh i understand now why it takes time! really hard to get there!
thank you for your help! awesome!

many many thanks!
you should consider to but such examples in the documentation! :slight_smile:
Cheers and thanks again
Harry

Hi Harry,

You’re welcome and it’s our pleasure to help you! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

hi,
I have one more question on this topic:

how can i display the output in 3 columns?
now it only shows the output one below the other. i have already tried several times.

can you support me again here?


thanks in advance for your help!

With kind regards
Harry

Hello @deranaloge,

I would suggest you go to the Looper setup —>Row(Please see the screenshot given by my colleague @marc_a, You need to set 3 columns layout to Row 1.2 )—> Layout —>Set it as 3 columns

Test-Page-Builder-Pro (8)

Hope it helps
Thanks

Hi,
i did change the row1.2 to 3 columns but that does not work, it still shows the entries liek 1 column.

any advice?
thanks in advance

Hi Harry,

The layout is too complex that’s why when you set it to 3 columns, it won’t show the proper columns. The solution I am seeing right now is to add element CSS to the Row 1.

$el {
 display: inline-block;
  width: 33.33% !important;
}

Once applied the layout should look like this one.

Please note that custom CSS code is outside the scope of our support. Issues that might arise from the use of custom CSS code and further enhancements should be directed to a third-party developer or you can avail One where we can answer questions outside of the features of our theme.

Hope that helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.