0

I have a stash variable set to the value of a transcribe variable at the top of my template:

{exp:stash:set name="where_to_buy_translation" parse_tags="yes"}
    {exp:transcribe:uri path='/where-to-buy'}
{/exp:stash:set}

Farther down in the template, I have a {exp:playa:parents} tag:

{exp:playa:parents field="accessory_parent_product" var_prefix="app" entry_id="{entry_id}"}
    <a href='{exp:stash:get name="where_to_buy_translation"}'>Where to Buy</a>
{/exp:playa:parents}

If I display the stash variable before the playa tag, it outputs correctly:

http://domain.com/en/where-to-buy

But inside the playa tag, it displays seemingly random text. This text is different depending on the channel entry being displayed, but is never the string I'm expecting. Is the value of that stash variable changing, or am I missing something here?

Note: I've tried using both the stash variable and a preload_replace, and while the output is different inside the playa tag it is always incorrect, whereas before the playa tag it is correct.

2

Repeated use of an identical single tag (as would be generated by the looping of the Playa tag pair) will cause EE to cache the value of the first instance. That means subsequent tag instances would be replaced with a marker such as M00093... which are then replaced with the value of the first instance later in the parse order.

I'm not sure why these markers get replaced with seemingly random text, but you can eliminate caching as a possible cause of your problem by adding the word 'random' to the {exp:stash:get}

{exp:stash:get name="where_to_buy_translation" random}
0

Try adding 'random' to the end of the opening stash tag without the quotes. {exp:stash ... parse_tags="yes" random}

  • No change. Still receiving expected string outside of the playa tag, and random text inside. – jrrdnx Sep 18 '13 at 13:13
  • You're going to have to give more info. Sample of the bad stash string and the wrapping playa tags – stuartmcd69 Sep 18 '13 at 13:52
  • Playa tag added to original question. The bad stash string changes depending on the channel entry being displayed, but varies from weirdly concatenated urls to other channel entry text, etc. – jrrdnx Sep 18 '13 at 14:02

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.