Get at querystring value above iframe

11 May, 2022 05:05:31
bbynes
Topics: 2
Messages: 4
Hi.

I have placed my own shortcode in my template. In that shortcode, I want to get at the querystring. But with e2pdf-view, it's creating an iframe. So I can't access the querystring. I tried a shortcode on the page I previously was using [e2pdf-view] and in that shortcode tried returning [e2pdf-view] with do_shortcode. Nothing displays.

Is there a better way to get at the querystring?
Is there a way I can use do_shortcode inside my own shortcode?

return do_shortcode( '[e2pdf-view id="2" responsive="true" hide="presentation,openfile"]');
Keep in mind, this shortcode works for me on it's own on the page, just not from inside another shortcode.

Thanks!
11 May, 2022 05:20:40
E2Pdf
Support
Topics: 7
Messages: 3156
Hi,

By default E2Pdf can't render $_GET or $_POST parameters inside PDF however it must be possible to accomplish the task with arg1, arg2, arg3 attributes by which you can send data to PDF via do_shortcode: https://e2pdf.com/support/docs#shortcode-e2pdf-view

The reason why do_shortcode doesn't work - it's required "dataset" to be defined so E2Pdf can know for which Page / Post / Entry it must be created PDF. So if E2Pdf Template connected to "Pages" - datasetsmust be Page ID, if to Custom Post Type - it must be the ID of some Custom Post Type. So the correct usage will be something like this: https://codeshare.io/wnYnK9

Inside E2Pdf Template you will need to use [e2pdf-arg key="arg1"] / [e2pdf-arg key="arg2"] to output data from arguments also keep attention to remove dbl quotes from string which must be rendered as via "arg" attributes.
We would really appreciate your feedback at WordPress.org!
19 May, 2022 08:17:46
bbynes
Topics: 2
Messages: 4
I wanted to get back to you that this worked well. Great support! Thanks.