I need to know outside of the Matrix tag pair the total rows that it has. To get total rows within the tag pair, this works for me:
{matrix_field_short_name}
<h1>{total_rows}</h1>
{/matrix_field_short_name}
Outside the tag pair, it seems like this should work: {matrix_field_short_name:total_rows}
per http://pixelandtonic.com/matrix/docs/templates. However, instead of getting an integer, I'm getting the string http://domain.com/member_uploads/_s:total_rows/slide.jpg
.
My Matrix field is names images
and it contains the columns image
(the file) and caption
(a text field).
Any idea what might be going on?
EDIT 1: Code Snippet
<h1>{images:total_rows}</h1>
{images}
<div class="{if row_count == 1}active{/if} item">
<img src="{image:250x250}" alt="{caption}"/>
</div>
<div class="carousel-caption">
<p>{caption}</p>
</div>
{/images}
{images}
works as expected. I don't get total rows in the h1.