Shortcode not working

WordPress Resolved
19 February, 2024 02:41:27
Stadtluft
Topics: 5
Messages: 9
Hi there :)

I am trying to display a Download PDF button to a Custom Post Type to download a PDF with the data from the Custom Post (I am suing ACF).

In the "Export" I can download the PDF and it's working but when I add the shortcode [e2pdf-download id="1"] to my template is not working.

I am using Bricks and when I add it it says that the Shortcode is empty. See attached screenshot.

The Template is acrtivated and as "Item" I chose the name of my Post Type "Kantone".

What am I doing wrong?

Many thanks in advance
A.
19 February, 2024 02:56:44
Stadtluft
Topics: 5
Messages: 9
PS: I also tried this way but when I click on the URL it simply redirect me to the same post and does not download the PDF

<a class="button" href="[e2pdf-download id=1]" target="_blank" rel="noopener">Custom Text or Icon</a>
19 February, 2024 04:27:51
E2Pdf
Support
Topics: 7
Messages: 3345
Hello,

Try please to use the shortcode below in the shortcode block or rich text.:

[e2pdf-download id="1" dataset="{post_id}"]
We would really appreciate your feedback at WordPress.org!
19 February, 2024 04:32:39
Stadtluft
Topics: 5
Messages: 9
Hi!

It's kind of working now. The only problem is that it downloads the PDF every time I reload the page.

How come?
19 February, 2024 04:34:02
E2Pdf
Support
Topics: 7
Messages: 3345
Check please if you didn't set "Auto Download" in the E2Pdf Template Settings: https://e2pdf.com/docs/templates/builder/settings#template
We would really appreciate your feedback at WordPress.org!
19 February, 2024 04:39:23
Stadtluft
Topics: 5
Messages: 9
Many thanks! :)

It works like a charm now.