Forum
Accessing repeater total items outside loop
Is there anyway to access the total items contained within a repeater tag outside of the repeater loop?
For example, with the following sample code:
<perch:repeater id="images" label="Images">
<img src="<perch:content type="image" id="image" label="Image" />"
alt="<perch:content type="text" id="alt" label="Description" />" />
</perch:repeater>
I want to be able to access the total number of items added to the images tag.
I think you might be able to do this:
Sadly not. Returns empty
:(
Or this?
Still no joy
Probably no then.
Okay - will have to do some client-side detection.
Thanks
Hi Drew
Would it be possible to make a feature request for this? Would be extremely useful.
Thanks,
Cole
Yes, of course.
I know this is a bit late and the thread is closed but would this give you the number you want?
Or if
after
is a bit hacky, show it on the last item instead?Mark this is a great solution and delivers what I need!