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

    I'm having a bit of trouble using getImageList to partition a set of articles by year. Basically, we have a timeline where selecting year should present news articles posted during that year. Problem is that the complete set of articles is produced for each year, as if the where clause was not present.

    Chunk reads:

    <div id="timeline_[[+company_timeline_year]]" class="timeline_year">
    	<p>Year presenting is [[+company_timeline_year]]</p>
    	[[getImageList?
    	    &docid=`100`
    	    &tvname=`news_article`
    	    &limit=`0`
    	    &tpl=`article_item_tpl`
    	    &where=`{"[[+tv.news_article_year]]:=":"[[+company_timeline_year]]"`]]
    </div>



    Tpl article_item_tpl reads:

    <div class="article_listing">
    	<span>Source: [[+news_article_source]]</span>
    	<span>Year: [[+news_article_year]]</span>
    	<span>Link: <a href="[[+news_article_url]]" target="_blank">[[+news_article_title]]</a></span>
    </div>



    Based on what's being written for the years, I believe things should be working.

    So my question really boils down to how to debug/figure out these types of issues when using getImageList...

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

      • 22427
      • 793 Posts
      Perhaps it's just the missing closing curly bracket?
      &where=`{"[[+tv.news_article_year]]:=":"[[+company_timeline_year]]"}`]]

        • 47562
        • 113 Posts
        Oh my, thank you! Just staring at it for too long; wish there was better reporting on silly parse errors...

        After adding that curly bracket, yet another problem: none of the entries get written, so the where appears to fail universally. Any thoughts on why that might be?

        Again, thanks so much for the help!
        • discuss.answer
          • 4172
          • 5,888 Posts
          I think, you want to filter by a MIGX-fieldname.

          &where=`{"yourYearField:=":"[[+company_timeline_year]]"}`
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 47562
            • 113 Posts
            Thanks Bruno! That's exactly what I was looking for...