Maybe this isn’t possible, but I’m trying to execute PHx within a chunk. I have the following section of code within the chunk.
<img src="[+portfolioImgSml001+]" alt="[+pagetitle+]" width="75" height="75" class="latestImgFormatSml001" />
[+portfolioImg002:len:gt=`0`:then=`<img src="[+portfolioImgSml002+]" alt="[+pagetitle+]" width="75" height="75" class="latestImgFormatSml002"/>`+]
[+portfolioImg003:len:gt=`0`:then=`<img src="[+portfolioImgSml003+]" alt="[+pagetitle+]" width="75" height="75" class="latestImgFormatSml003"/>`+]
[+portfolioImg004:len:gt=`0`:then=`<img src="[+portfolioImgSml004+]" alt="[+pagetitle+]" width="75" height="75" class="latestImgFormatSml004"/>`+]
The first image portfolioImgSml001 displays without issue of course. However, the second (portfolioImgSml002 does not display an image. I get the broken image, but the alt tag is working. The image is in the assets folder because it works effectively on another page. The 3rd and 4th images do not display as expected, but there are no images associated with these TVs.
It seems like it recognizes that there is an image because it places it appropriately including the alt tag, but it’s just not displaying it. Is it even possible to do this? I’m really new to this so any help is greatly appreciated.
Thank you for your comment. Unfortunately, that didn’t seem to work. Now there is no display not even a broken image link.
Anyone else care to weigh in?
[*portfolioImg004:ifnottempty=`<img src="[+portfolioImgSml002+]" alt="[+pagetitle+]" width="75" height="75" class="latestImgFormatSml002"/>`*]
The phx:snippet ifnotempty is here:
http://wiki.modxcms.com/index.php/PHx/CustomModifiers#phx:ifnotempty
it should work.
How are you calling the chunk, directly from a template or document, or via a snippet e.g. Ditto?
I think the newer version of ditto doesnt need the hiddenfields option. I always forgot that and it’s a good reason to upgrade.