ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Matrix - Show numbered links for pagination?

July 01, 2010 11:40am

Subscribe [1]
  • #1 / Jul 01, 2010 11:40am

    tubes1

    32 posts

    Hi. I asked this in the Pixel & Tonic forum yesterday but it may be more suited for here.

    I got pagination working in Matrix for a gallery I’m making using the tutorial on the Pixel & Tonic site. It shows previous & next links to toggle through the Matrix Entries.

    But what I’d really like to display is an unordered list of number links (1 2 3 4…) based on how many Matrix rows there are in a given entry. Has anyone done this? I’d like Matrix to only show the numbers based on how many Matrix rows and the numbers would link to display that row. And I just can’t wrap my head around how to do it.

    Maybe my image will describe it better…

    And here is the link to the actual site I’m working on.
    http://www.boxingcatscreative.com/index.php/work/photo-direction/photo_direction_start/

    I’d appreciate any help anyone could give. Thanks.

  • #2 / Jul 08, 2010 12:19pm

    tubes1

    32 posts

    Anyone? I think I could figure it out if I could just know how to pull the number of matrix entries and display them.

  • #3 / Jul 09, 2010 11:44am

    tubes1

    32 posts

    I figured it out. It’s pretty simple, actually. It just took me forever.

    Here’s how you do it.

    {if {gallery:total_rows} > 1}
    {gallery}
    <a href="http://{path=%27work/{section}/{url_title}/{exp:simple_math">{row_count}</a>
    {/gallery}
    {/if}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases