Project:Google Highly Open Participation Contest (GHOP)
Component:Task idea
Category:task
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

Imagine a situation you need to list some nodes from second to latest. You just doesn't need the first one, because it's already displayed somewhere.

This task proposes a new functionality of views: Limiting offsets. When implemented, you will be available to limit a view to list particular nodes.

For example (SQL like syntax)
select nodes where type of node is Story order by title limit 1, 10 - list nodes from second to tenth
select nodes where type of node is Story order by title limit 10, 15 - list nodes from tenth to fifteenth

When implementing, you should use http://api.drupal.org/api/function/db_query_range/6

I think there are two approaches:
- completely new collapsible fieldset in Views UI
- views filter "Offset: Start" and "Offset: End"

The latter could maybe implemented using external module without altering Views module - verify it...

Comments

#1

Status:active» postponed (maintainer needs more info)

Hm. Need merlin's take on this and whether it's a) a desirable feature of Views and b) he would have availability to mentor it.

#2

The offset already exists, but there is no UI for it.

Only the start is given, because there is already an end: number of nodes per page. And it doesn't work with the pager query, because there's no way I can find to modify the actual offset used with the pager.

As a task to create a patch to add this to the UI, I'll plus 1 that several times. Many people have requested it; no one has stepped up to patch it, and my priority list has been elsewhere.

#3

Sounds like a good idea since merlin is behind it. The only thing is that it needs someone who can mentor the student. If meba is willing and capable then go for it.

One other thing--please make it clear whether this should be a patch for Views 1.6 (I'm assuming that's the case) or Views2. If 1.6, you need to revise or remove this:

When implementing, you should use http://api.drupal.org/api/function/db_query_range/6

#4

Status:postponed (maintainer needs more info)» needs work

#5

It has to be for Views 1.6, at this time; and since db_query_range() is already in use in Views, that piece of info is not actually relevant to the task.

The task would consist of:

Add two field do the views_view table
Ensure the field is loaded/saved properly
Add the UI elements to control this field
Ensure that the field is utilized for the offset in the page and block handlers.