Shortcode to ACF Advanced Views?

WordPress
10 January, 2024 06:35:17
PeterPDF
Topics: 1
Messages: 3
Is it possible to reference a shortcode from another plugin?

Background - I use Advanced Views Lite plugin to display a big list of ACF fields. The plugin gives me a shortcode to that list.

Can I reference that shortcode to include in the generated PDF?

Thanks for pointing me the right way!
10 January, 2024 07:13:52
E2Pdf
Support
Topics: 7
Messages: 3163
Hello,

E2Pdf supports 3rd party shortcodes, however, it also depends on the designed shortcode that will be used as sometimes shortcodes try to access data that is not available in the PDF context. You can just try to use it with the "FREE" version of E2Pdf to see if it will be rendered correctly.
We would really appreciate your feedback at WordPress.org!
6 February, 2024 07:59:05
PeterPDF
Topics: 1
Messages: 3
Hmmm- Sorry - I'm still struggling. (it's me!)

I'm using ACF and ACF Advanced Views. That gives me a shortcode of ...
[acf_views name="ACF mics view" view-id="6542552b68180"]
(the shortcode works fine in other areas of the website)

If I put that shortcode into a template textfield......nothing shows when the PDF is created. Just blank.

Any advice is gratefully welcomed. Thanks
6 February, 2024 08:27:58
E2Pdf
Support
Topics: 7
Messages: 3163
Hello,

Can you please try to modify the shortcode to:

[acf_views name="ACF mics view" view-id="6542552b68180" object-id="[id]"]

or

[acf_views name="ACF mics view" view-id="6542552b68180" object-id="[e2pdf-dataset]"]

If it still doesn't work, please let us know the connection of your E2Pdf Template and if acf_views must get data from the same post for which you are generating the PDF.
We would really appreciate your feedback at WordPress.org!
7 February, 2024 01:23:23
PeterPDF
Topics: 1
Messages: 3
great - thank you. With [acf_views name="ACF mics view" view-id="6542552b68180" object-id="[e2pdf-dataset]"] it's almost there.

I now safely get the data from the acf_views....
but it renders in the PDF as

"<div class="acf-view acf-view--id--6542552b68180 acf- view--object-id--1091"><div class="acf- view__transducer-type"><div class="acf- view__transducer-type-label">Transducer Type text</div><div class="acf-view__transducer-type- field">Dynamic</div></div><div class="acf- view__frequency-response"><div class="acf- view__frequency-response-label">FR</div><div class="acf-view__frequency-response-field">50 Hz - 12 KHz</div></div><div class="acf-view__polar- pattern">Super cardioid</div>"

So the data I need is in there but how to get it to only render the field data (eg "Dynamic / 50 Hz -12 KHz / Super cardioid)

My E2Pdf template is connected to my Products - Woocommerce.
Yes - acf_views gets the data from the same post for which I'm generating the PDF.

Sorry if I'm dumb! Thank you!
7 February, 2024 02:04:59
E2Pdf
Support
Topics: 7
Messages: 3163
Currently, we can see 2 possible solutions:

1. If you have PHP knowledge - modify the output via PHP filter. Parse the value and modify the output as you need. If it's okay for you, let us know please so we can provide you with a basic hook on how values can be modified.

or

2. Modify the ACF View output template. As we understand it must be possible. You can just try to clone it and modify it to output on your needs. See please the screenshot attached.
We would really appreciate your feedback at WordPress.org!