So I have my content that I put on my template article.html via the EE-publishform where I also get to choose wether to use layouts 'normal' or ' wide'. The size of the images varies depending on wich layout I use. CE_image is what I use to resize images.


What I cant figure out is how to let CE_image do its work on the layout-template instead of on the article-template. Or if I could put the CE_image-tags on the article-template and then let the layout-templates insert apropriate values to size, crop and quality variables.


I realize Stash is a genuinly complex and competent addon and the solution to my problem is probably right there in the Stash documentation. I have read it over and over and tried things over and over but I never seem to hit the keys in the right order. So I am very ready for some advice on this matter.

Thanks /David


  • title
  • body
  • images (matrix-field)
    • img-1
    • img-2
    • img-3



{exp:channel:entries channel="archive" limit="1" url_title="{segment_2}"}


{exp:stash:set name="title"} {title} {/exp:stash:set}

{exp:stash:set name="content"} {f-body} {/exp:stash:set}

{exp:stash:set name="images"} {f-archive-images} {exp:ce_img:pair src="{f-archive-images-image}" width="400" crop="yes" quality="80"} {/exp:ce_img:pair} {/f-archive-images} {/exp:stash:set}




normal template


wide template

1 Answer 1


You'd be better off just 'stashing' the image urls and using the CE Image tag from within the layout.


  {exp:stash:set_list name="images"}


First image:
{exp:stash:get_list name="images" limit="1"}
  {exp:ce_img:single src="{url}" width="400" crop="yes"}

Second and third images:
{exp:stash:get_list name="images" offset="1" limit="2"}
  {exp:ce_img:single src="{url}" width="400" crop="yes"}

The point is that you are trying to keep your presentation separate. The CE Image tag, to me, is a presentational tag. You just need to get the image url to the layout. The above is one way to do it.

You could also use three separate {exp:stash:set name="image_x"}{/exp:stash:set} tags. Whatever you find that works.

  • Ah, it was the list-thingy! thanks a lot!
    – David S
    Commented May 4, 2013 at 21:05

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.