MIGX title placeholder not showing,image is?

I am trying to use MIGX with pthumb for a gallery.
This is the part of the template

[[getImageList?
        &tpl=`pictureImage`
        &tvname=`gallery`
        ]]

tpl

<figure>
  <picture>
<source srcset="[[pthumb? &input=`[[+image]]` &options=`f=webp`]]" type="image/webp"/>
<source srcset="[[pthumb? &input=`[[+image]]`" type="image/png"/>
<img src="[[pthumb? &input=`[[+image]]`" alt=`[[+title]]`/>
</picture>
<figcaption>[[+description]]</figcaption>
</figure>

Gallery tv

 [{
"caption": "Info",
"fields": [{
    "field": "title",
    "caption": "Title"
  },
  {
    "field": "description",
    "caption": "Description",
    "inputTVtype": "richtext"
  }
]
},
{
"caption": "Image",
"fields": [{
  "field": "image",
  "caption": "Image",
  "inputTVtype": "image"
}]
}
]

  [
 {
 "header": "Title",
 "width": "160",
 "sortable": "true",
 "dataIndex": "title"
}, {
"header": "Image",
"width": "50",
"sortable": "false",
"dataIndex": "image",
"renderer": "this.renderImage"
}]

It looks like there are some problems with the MODX tags:

  • The pthumb tag ([[pthumb) is opened, but never closed ( → ]]).
  • The “alt” attribute is missing the double quotes (")

This line should probably should look like this:

<img src="[[pthumb? &input=`[[+image]]`]]" alt="[[+title]]"/>
2 Likes

How did I not notice?
I was adopting a tutorial. The backticks was me trying other things out.
It works now thanks.

1 Like

Do you know how I can add a class to the first image and default classes to the rest of the images?

The getImageList snippet provides additional placeholders (like [[+_first]] or [[+idx]]) that you can use in the template chunk “pictureImage”:

class="[[+_first:is=`1`:then=`some_class`:else=`other_class`]]"

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.