1

We're using an EE (2.6.1) plug-in that doesn't process embedded templates, which we would like to use.

When we embed a template inside of the code below the embeded code displays exactly as is, non-parsed static text.

We've tried adjusting the PHP parsing order, since some of the embedded templates use PHP. We've tried parse="inward" on the channel tag, switching tag orders and even snippets to no avail.

Any help pointing me in the right direction would be greatly appreciated.

Code excerpt from top of template:

{exp:channel:entries channel="people" limit="1"}
{exp:shine_pdf:make
    format="letter"
    default_font_size="11"
    default_font="Helvetica"
    margin_left="0"
    margin_right="0"
    margin_top="0"
    margin_bottom="0"
    margin_header="0"
    margin_footer="0"
    orientation="p"
    margin_top_auto="no"
    margin_bottom_auto="no"

channel="people"

limit="1"
}

1 Answer 1

2

Embed templates don't parse in the way you're expecting them to. And PHP will be irrelevant here to.

What's happening is EE parses the parent template first - completely, so in your example it will parse the exp:channel:entries tag, then the exp:shine_pdf tag. These will be complete and fully parsed. Finished.

Then EE will parse the embedded templates in exactly the same way, until completely parsed.

EE will then insert the parsed child template into the position you requested in the already parsed parent template. Therefore the parent tags will never be able to utilise the content of the child.

So in your instance, the PDF is already created and done before EE begins to look at the embedded template.

The only way to solve the issue is to not have an embed, or that your shine_pdf tag is in the embedded template (possibly passing any relevant variables from the channel:entries to the embed...?).

Here's an excellent reference to parsing order: http://loweblog.com/downloads/ee-parse-order.pdf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.