• Resolved nicmare

    (@nicmare)


    I am using your plugin with formidable. Any chance to pass the entry value shortcodes in my custom shortcode? like:
    [myshortcode firstname=[318] lastname=[319]]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter nicmare

    (@nicmare)

    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.

    Thread Starter nicmare

    (@nicmare)

    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 3 years, 11 months ago by nicmare.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Nested Shortcode support?’ is closed to new replies.