I hear rumors that this is possible.

I want to set up a photo gallery that only shows 10 of 100+ photos. User click paginated links to see more photos.

Anybody ever have to set this up? I hear a rumor it requires Simple Math?

If you have a solution, share it!

2 Answers 2


Here's a fairly simple pagination with only a previous and next button example. It should give you a good place to start. The example uses pagination number in the 3rd segment and instead of Simple Math uses Math plugin. May have over commented, but:

{!--   how many matrix rows per page?   --}

{exp:channel:entries channel="YOUR_CHANNEL" url_title="YOUR_URL_TITLE" dynamic="no"} 


        {!--   matrix rows   --}
        {YOUR_MATRIX_FIELD offset="{segment_3}" limit="{rows_per_page}"}
            {!--   etc...   --}

        {!-- ---------------------- 
        previous link 
        ---------------------- --}
        {!--   if we're on the second page   --}
        {if "{segment_3}" == "{rows_per_page}"} 
            <a href="{path='YOUR_TEMPLATE_GROUP/YOUR_TEMPLATE'}">Prev</a>  

        {!--   else if we're further along in pages   --} 
        {if:elseif "{segment_3}" > "{rows_per_page}"} 
            <a href="{path='YOUR_TEMPLATE_GROUP/YOUR_TEMPLATE/{exp:math formula='{segment_3} - {rows_per_page}' absolute='yes'}'}">Prev</a>   

        {!-- ---------------------- 
        next link 
        ---------------------- --}
        {!--   if the total matrix rows are greater than sum of pagination segment plus rows per page   --}
        {if "{YOUR_MATRIX_FIELD:total_rows}" > "{exp:math formula='{segment_3} + {rows_per_page}' absolute='yes'}"}
            {!--   if not on the first page calculate next page segment, else show link to second page   --}
            <a href="{path='YOUR_TEMPLATE_GROUP/YOUR_TEMPLATE/{if segment_3}{exp:math formula='{segment_3} + {rows_per_page}' absolute='yes'}{if:else}{rows_per_page}{/if}'}">Next</a>   


(this example builds on a related answer here)


First don't get it to work (next area) {YOUR_MATRIX_FIELD:total_rows} returns the entry of cell_1 if I use

if "{{YOUR_MATRIX_FIELD limit="1"}{field_total_rows}{/YOUR_MATRIX_FIELD}}" > "{exp:math formula='{segment_3} + {rows_per_page}' absolute='yes'}"}

It works fine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.