Hi,
I'm creating a simple image gallery with MIGX, and I'm using a custom pager in the frontend.
The gallery/pager is supposed to have "categories", and this is how I have done it:
MIGX form:
[
{"caption":"Gallery item", "fields": [
{"field":"type","caption":"Type","inputTV":"migxGalleryItemType"},
{"field":"category","caption":"Category"},
{"field":"image","caption":"Image","inputTV":"migxGalleryImage"}
]}
]
So first you choose the item type (image or category), and then you can enter the category name OR choose the image. Works fine so far. Simple to use.
What I need is to set this up for the frontend for which I need two type of counters.
This is how it's supposed to look:
Main images category: 1 2 3
Other images category: 1 2
Using +idx in the rowTpl will count all migx rows, both images and categories, which of course is useless for my display needs.
This is how the rowTpl could look like:
[[+type:is=`category`:then=`<h1>[[+category]]</h1>`:else=``]]
[[+type:is=`image`:then=`<a href="#" data-cycle-cmd="goto" data-cycle-arg="[[+idx_only_images]]">[[+idx_only_since_previous_category]]</a>`:else=``]]
I need one counter/iterator to count only rows with type 'image'. (to hook it up with the data-cycle-arg)
And an other counter that only counts since previous category (i.e. resets with every category).
How do I do these special counters? A snippet that calls getImageList where I can get the migx items and count them the way I want? I'm not sure how to go further.
Maybe there is an other simpler way to achieve what I want?
Thanks.
/E
[ed. note: Eminos last edited this post 12 years, 9 months ago.]