We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5143
    • 116 Posts
    Hi there,

    As the title suggests, I'm trying to add alt attributes to all of my images that are retrieved with MIGX's getImageList snippet.
    My code is as follows:

    In my "Event" template is the initial call to a MIGX TV:
    <ul class="event-content-list">
        [[!getImageList?
           &tvname=`Content-Block`
           &tpl=`Content-Block-Tpl`]]
    </ul>

    And in the "Content-Block-Tpl" there is another call:
    [[!getImageList?
       &value=`[[+images]]`
       &tpl=`Event-Artist-Image-Tpl`
       &imageAltAttr=`[[+pagetitle]]`]]

    And finally the "Event-Artist-Image-Tpl":
    <img src="assets/files/[[+media]]" alt="[[+imageAltAttr]]"/>


    Everything works apart from the alt attribute part. I assume it's because I can't get the page title from within a chunk - if that's the case, is there a way to pass a value from a resource into a chunk?

    Failing that, any alternative methods would be fine if there are other ways of accomplishing the same.

    Chris

    ModX Revo 2.2.12pl