0

I have some legacy code that was using mx_jumper successfully. On updating to EE 2.11.2 the code no longer works.

The context is a Matrix field with rows including:

  • A text field called {item_desc}
  • An Assets field called {item_img}, containing 0, one or more images

Each Matrix row instance of {item_desc} may include placeholder text referring to an image in {item_img}. For example, in a placeholder such as {img_3_1}, 3 is the row count and 1 is the image count within the Assets field.

My legacy snippet, running within each Matrix row, has code including this…

{item_img}
    {exp:mx_jumper:put name="img_{row_count}_{count}"}
    <figure{if item_img_align} class="{item_img_align}"{/if}>
      <img src="{url}" alt="{alt_text}">
      {if caption}<figcaption{if keywords} class="{keywords}"{/if}>{caption}</figcaption>{/if}
    </figure>
    {/exp:mx_jumper:put}
{/item_img}

{exp:mx_jumper:out_global}
    {item_desc}
{/exp:mx_jumper:out_global}

But on EE 2.11.2 this no longer works.

I can't figure a way to use quotes or wrapping {} within the mx_jumper name parameter to get it to play ball.

But I'm sure there's a better way to do this using Stash.

I've had a look at Mark Croxton's Replacing matrix image slugs into another field but I can't figure how to adapt it for my above context.

I'm aware of inefficiencies within my old approach, but at this point I just need to get it working again without having to change content.

Any help much appreciated.

My above code has been updated to correct errors made when originally posted.

0

Robin Sowell of EllisLab pointed me to the solution, via a ticket, which was to move exp:mx_jumper:out_global out of the snippet into the embed that was calling it.

Converting the above approach to Stash can wait for another day.

| improve this answer | |

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.