0

I have an array with this structure:

$things = array('term1' => array(Object, Object, ... Object),
                'term2' => array(Object, Object, ... Object),
                'term3' => array(Object, Object, ... Object),
                 .... etc...

I want to be able to generate output like:

Term1

* Object 1
* Object 2
* ... etc ...

 < 1, 2, 3 > (<-- that's pagination :D)

Term2

* Object 1
* Object 2
* ... etc ...

 < 1, 2, 3 >

Which each list of things paginated (assuming there are more than x of them).

Is there a way I can achieve this?

A template function I can pass each of the individual arrays of Objects into to get pagination?

If it matters, this is all taking place inside a block, in D7.

0

See Drupal Pagination with a Custom Query for full code example

  • Cheers, the second example looks like that I want. – robomc Jul 23 '12 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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