Plugin Author
E2Pdf
(@oleksandrz)
Hi,
Currently it’s possible to use only [id] and [key] as nested shortcode attributes so to solve the task we can offer you 2 possibilities to solve the task:
1st solution:
Create Formidable Forms View with shortcode inside:
[myshortcode firstname="[318]" lastname="[319]"]
And use inside E2Pdf Template:
[display-frm-data id=123 filter=limited entry_id="[id]"]
* where 123 is the ID of Formidable Form View.
2nd solution:
Create custom shortcode wrapper which will generate shortcode as you need. Here is the code example which must be added to theme functions.php or PHP snippet: https://codeshare.io/G6NrKY
After adding code it will be need to use:
[myshortcode-wrapper dataset="[id]"]
We remain at your service.
great! 2nd solution is what i was looking for. for my needs the final code is this:
function myshortcode_wrapper($atts) {
if (isset($atts['dataset']) && !empty($atts['dataset']) && class_exists('FrmEntry')) {
if ($entry = FrmEntry::getOne(sanitize_key($atts['dataset']))){
$form = FrmForm::getOne($entry->form_id);
$shortcode = '[intro_text anrede="[318]" fullname="[311]" anlass="[214]" datum="[165]" location="[171 show=value]"]';
return do_shortcode(apply_filters('frm_content', $shortcode, $form, $entry));
}
}
return '';
}
add_shortcode('intro_text_e2pdf', 'myshortcode_wrapper');
then in the e2pdf template i call it this way:
[intro_text_e2pdf dataset="[id]"]
thank you very much!
-
This reply was modified 5 years, 1 month ago by
nicmare.