1

I'm trying to do some stash embeds but when embeds contain nested plugins (so, more than one) he doesn't retrive any value.

{my_loop}{stash:embed name="my_total{count}" file_name="_stash:total_htva_stash" stash:collection_name="acompte{count}" process="inline" parse_stage="set"}{/my_loop}

My embed stash template :

{exp:mx_calc expression="round(({exp:tally:total collection='{stash:collection_name}' decimals='2'}*0.21),2)" parse="inward"}{calc_result}{/exp:mx_calc}

If I just put 1 plugin in the embed :

{exp:tally:total collection='{stash:collection_name}' decimals='2'}

the embed retrieve a sum (tally plugin is made to sum some numbers) but when I put tally into mx calculator (to do a math on the tally's sum) it doesn't work. When I made it in EE embed it works but I need stash embed to use the result as a variable in the host template.

I don't know if it is clear (english is not my mother tongue).

1

Try adding parse_depth="x" to the Stash embed, where 'x' is a number greater than 4 (which is the default).

EDIT:

You are effectively using the embed like a snippet, so I would suggest including the embed before tag processing begins, without parsing it so that you can still pass it variables during:

{stash:embed name="my_total{count}" file_name="_stash:total_htva_stash" process="start" parse="no"} 

Rather than {stash:collection_name} use {acompte{count}} in the embed.

| improve this answer | |
  • Hi Mark, thanks I tried it but it doesn't work... – pikarge Dec 16 '13 at 11:41
  • Did my advice here help? devot-ee.com/add-ons/support/stash/viewthread/11291 – Mark Croxton Dec 18 '13 at 13:13
  • In fact I did everything you said in the devot-ee thread, so I replaced every EE embeds by stash embeds but still have problem to retrieve the right value of these embeds (because they contain nested plugins). I tried to add parse_depth parameter as you suggested but it doesn't work. I try to achieve my project but I'm stuck with this problem. – pikarge Dec 20 '13 at 10:36
  • Please see edit above – Mark Croxton Dec 20 '13 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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