It seems sometimes a variable within a tag argument will be parsed and other times it won’t be. I can’t figure out what determines it.
I’m using Image Sizer to resize images. The path to the image is stored in a variable. At one point in my template, passing a variable works. At another point in the same template, it doesn’t work. The variable I’m passing is called “main_image” and comes from the current entry within the loop. For example:
Use case 1 (works)
{exp:channel:entries .... }
main image: {main_image} </br>
<!-- passing {main_image} works -->
{exp:imgsizer:size src="{main_image}" width="150"}
{sized}
{/exp:imgsizer:size}
{/exp:channel:entries}Use case 2 (doesn’t work)
{exp:myPlugin:getEntries .... }
main image: {main_image} </br>
<!-- passing {main_image} does not work -->
{exp:imgsizer:size src="{main_image}" width="150"}
{sized}
{/exp:imgsizer:size}
{/exp:myPlugin:getEntries}- In the second use case, “inner” markup is rendered by myPlugin via EE->TMPL->parse_variables.
- In the second use case, Image Sizer receives the image src as “{main_image}” i.e. the unparsed variable name.
- I can successfully print main_image value outside of the imgsizer tag in both cases.