We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53855
    • 2 Posts
    - ModX 1.0.10
    - 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!

    This question has been answered by fourroses666. See the first response.

    • discuss.answer
      • 9995
      • 1,613 Posts
      Don't use the widget for the image.

      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="" />`+]
        Evolution user, I like the back-end speed and simplicity smiley