-
- 5,888 Posts
what defines your thumb, small and large images, or better, what is your MIGX - setup and what looks the json-output of your MIGX-TV (without getImageList)
and what ist the html-output, which you would need?
-
- 5,888 Posts
for the first image, I think, you can just use another getImageList-call with
&limit=`1`
and its own tpl-chunk (or inline chunk)
[[getImageList?
&tvname=`zoom-slide-show`
&tpl=`firstImageTpl`
&limit=`1`
]]
btw:
you can call getImageList cached!
There is no need to call it uncached.
-
- 416 Posts
Right, I understand I can get the first one. But, what I need is to display the 2nd and 3rd image.
Thanks for the tip on the cache.
Does getImageList have an offset property?
Yes, it does, it also has the ability to put the results into placeholders that you could manipulate to just display the items you want. I'm not sure how you could use the 'where' property, I don't happen to have an installation with a MIGx image list handy to examine the actual TV content.
You might be better off using a custom table and MigxDB for such fine-tuning.
[ed. note: sottwell last edited this post 9 years, 8 months ago.]
-
- 416 Posts
Ok, this works, but I want to make it more bullet proof.
If the client changes the order in the slide show, the MIGX_id doesn't change. What I really want to use is some form of idx.
There is a placeholder for [[+idx]] that I can use in the output, however, I'm not sure how to access this in the &where statement. I assume that idx is generated during output so it's not in the json array.
Do I need to add another field along with the images for idx?
Not sure how to approach this. Any thoughts?
Update:
I realized since I want only the first record, I can use &limit=`1`. The order is changed, it will always choose the first record. Problem solved.
Having said that, this worked for me in this case, but what if really did want to access a specific position other than the first, such as the fourth record, how might I have done so. Just curious.
[ed. note: terrybarth last edited this post 9 years, 8 months ago.]
Bruno certainly knows this better than I do, but you might need to make your own snippet to use PHP's JSON handling library. Or perhaps convert it into an array and then work with the array.
-
- 5,888 Posts
but what if really did want to access a specific position other than the first
note:
there was a bug with offset, which should be fixed at the version at github
https://raw.githubusercontent.com/Bruno17/MIGX/master/core/components/migx/elements/snippets/getimagelist.snippet.php