<![CDATA[ How to get a link to a TV-image in Ditto? - My Forums]]> https://forums.modx.com/thread/?thread=103063 <![CDATA[How to get a link to a TV-image in Ditto?]]> https://forums.modx.com/thread/103063/how-to-get-a-link-to-a-tv-image-in-ditto#dis-post-554833 - Ditto 2.1.0
- Template variable [*image160x180*], Input Type:Image, Widget:Image

Chunk "ImageList":
<ul>
[[Ditto? &tpl=`myItem` &parent=`[*id*]`]]
</ul>

Chunk "myItem":
<li>
<a href="[+image160x180+]"> </a>
</li>

As I suppose, the chunk "ImageList" should produce such a code:
<ul>
<li>
<a href="dir1/dir2/image1.jpg"> </a>
</li>
<li>
<a href="dir1/dir2/image2.jpg"> </a>
</li>
...
<ul>

In fact it produces:
<ul>
<li>
<a href="<img src="" alt="some text" "> </a>
</li>
...
<ul>

That is, no link to image is put into "href", instead, it puts tag <src> with all attributes.

How to get a link to a TV-image in Ditto, so it can be put into attribute "href"?
Thanks in advance!]]>
alexshag Oct 28, 2017, 04:51 PM https://forums.modx.com/thread/103063/how-to-get-a-link-to-a-tv-image-in-ditto#dis-post-554833
<![CDATA[Re: How to get a link to a TV-image in Ditto? (Best Answer)]]> https://forums.modx.com/thread/103063/how-to-get-a-link-to-a-tv-image-in-ditto#dis-post-554866
If you want to show an image when its there:
[+image160x180:is=``:then=``:else=`<img src="[+image160x180+]" width="160" height="180" alt="" />`+]


OR:

[+image160x180:is=``:then=``:else=`<img src="[[phpthumb? &input=`[+image160x180+]` &options=`w=160,h=180,zc=1`]]" width="160" height="180" alt="" />`+]
]]>
fourroses666 Oct 31, 2017, 08:23 AM https://forums.modx.com/thread/103063/how-to-get-a-link-to-a-tv-image-in-ditto#dis-post-554866