We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51315
    • 67 Posts
    I am encountering a problem trying to use getImageList's toPlaceholder inside pdoResources for outputfiltering.

    Here is the code:

            [[!getImageList?
                &tvname=`resourcealbumproduct`
                &tpl=`imageAvailableTpl`
                &where=`{"published":"1"}`
                &docid=`[[+id]]`
                &toPlaceholder=`image`
            ]]
            [[+image:is=``:then=`
            [[+pagetitle:strip]]
            `:else=`
            <a href="[[~[[+id]]]]">[[+pagetitle:strip]]</a>
            `]]


    I have a list of resources to show and not all of them has an image (MIGX gallery).
    So, translated: if the resource has an image the page title should be a link; otherwise the page title is just text.

    It looks like getImageList output is not working properly when sent to a placeholder.
    For example, some resources with images are treated as if they don't have images.
    Or, in a big list, the output is fine until the first resource containing an image is processed, after that, every resource is treated like having an image (and it is not the case).

    On the other hand, without toPlaceholder everything works fine and images show up properly when found in the resource's MIGIX TV:

    [[!getImageList?
                &tvname=`resourcealbumproduct`
                &tpl=`imageAvailableTpl`
                &where=`{"published":"1"}`
                &docid=`[[+id]]`
            ]]


    Any suggestion? [ed. note: fredela last edited this post 7 years ago.]
      • 51315
      • 67 Posts
      Well, actually it should look like this:

              [[!getImageList?
                  &tvname=`resourcealbumproduct`
                  &tpl=`imageAvailableTpl`
                  &where=`{"published":"1"}`
                  &docid=`[[+id]]`
              ]]


      And the template:

      [[+image:is=``:then=`
      [[+pagetitle:strip]]
      `:else=`
      <a href="[[~[[+id]]]]">[[+pagetitle:strip]]</a>
      `]]


      Anyway, the problem is still there.

      The output modifier is not working.
      When [[+image]] is empty (no image in the resourcealbumproduct TV) nothing is shown.
      Only "else" works, "then" is not taken into account.

      Am i missing something? [ed. note: fredela last edited this post 7 years ago.]
        • 51315
        • 67 Posts
        Well i read every post and tried everything, snippet cashed/uncashed, placeholder cashed/uncashed, any possible output filter.
        Still no results.
        The "then" code supposed to be shown is not showing but "else" works.