[development] how to use an argument to get a row to appear first in a View

John Fiala jcfiala at gmail.com
Mon Mar 28 15:30:05 UTC 2011


On Mon, Mar 28, 2011 at 9:03 AM, Idan Arbel <idan at arbel-designs.com> wrote:
> Hello,
>
> I have a views slideshow, and in some cases I’d like a certain node to
> appear first in the order, I don’t really care about the rest of the nodes
> just to move a certain node to be first in the slideshow.
>
> I’m looking to achieve this using an argument, maybe sending in the nid, or
> even better a certain value for another field.
>
Hm.

Well, if you've got no pager, here's an idea:

You've got two displays - one display (the main one) which displays
one item, and a second display that displays the rest.  Display one is
set up to display only the node provided via the argument, so that's
automatically first.  The second display is made into an attachment on
the first display, which inherits the same argument, only on the
second display the argument defines the node that isn't displayed.

The tricky thing is the way you're displaying them as a grid - that
may not work with having the page split into two views without a lot
of work with css and/or alternate view templates.  It might be simpler
to have a 'grand' display of the argument node on top of a grid
showing the rest of them.

-- 
John Fiala
www.jcfiala.net


More information about the development mailing list