3

I am using Drupal 7.8, built a custom cck type, populated it with content, and created a view with full pager of 10 items per page.

I'm modifying the views theme Row Style Output - views-view-fields.tpl.php to do something, but every-time I try to collect the entire views result set, I only get the first 10.

ie. foreach($view->result as $id => $data) { // track $data->field }

How do I bypass the pagination limits so that in my views template I have access to all the results (which is over 20+)?

Here is an example layout of my cck type -

CCK TYPE: Videos; CCK FIELDs: title, body, url, date_recorded

date_recorded is a custom date format which only has Month, Year.

The view filters and groups these fields by date_recorded, and uses full pager for 10 items like so :

Feb 2012
- Video 1 
- Video 2

Dec 2011
- Video 3
- VIdeo 4

...

PS - This is the 2nd part of a question that began here - Alternative ways to group results of a view by CCK field?

6
  • What information from the "full" view (all of the "pages") are you wanting? There may be another way to get it.
    – Jimajamma
    Commented Mar 6, 2012 at 22:45
  • ...from the other question, if you could give some details of your data/field layout and grouping info, etc, it may be easy for you to "page" this yourself, eg, grab the whole thing instead of having views do the 10 limits, do your data manipulation, and then page it out
    – Jimajamma
    Commented Mar 6, 2012 at 22:52
  • If I understand: You want to use the views pager for display & navigation, but in the template you want to access all of the results? Or do you want to remove the views pager & show all of the results?
    – Merrick
    Commented Mar 7, 2012 at 4:09
  • re: Merrick, I want to use the views pager for display and navigation (limit 10 per page), but in the template I want to access all the of the results.
    – Robbase
    Commented Mar 7, 2012 at 12:46
  • do you want 10 months of however many videos per page, or do you want to have a max of 10 videos displayed per page?
    – Jimajamma
    Commented Mar 8, 2012 at 5:49

1 Answer 1

0

Set up a second display on your view or a new view that has no pagination or limit on the number of items displayed and use views_get_view_result to retrieve the object.

1
  • I don't have to tell you that you are increasing overhead substantially on each page load by doing this. Are there not Views features you could use to achieve your goals?
    – Duncanmoo
    Commented Jul 10, 2012 at 11:51

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.