Using Argument Selector for selecting and comparing nodes

Last updated on
30 April 2025

In a website for comparing products you typically want to show a general list of products that can be sorted. You also want the user to be able to select the most interesting rows for a more detailed comparison. VBO now includes an action that lets you do this - Argument Selector (added in the 6.x-1.8 version).

Argument Selector can be used for any kind of objects that VBO supports, but this example uses nodes. The arguments can be passed to any kind of page. In this example we pass them to another view.

Step 1: Create the target view

Create a new view for the detailed comparison. This should be an ordinary view without VBO. Add "Node: nid" as Argument. In the configuration for this argument, set Validator to Node, set Types to the node type you want to use, set Argument type to "Node IDs separated by , or +" and check "Allow multiple terms per argument".

Add a page display to the view and set an appropriate path for it, for instance "products/detailed". Click Save.

Step 2: Create the action

Go to admin/settings/actions. In the list of advanced actions you select "Pass objects as arguments to a page..." and click the Create button.

There are two fields to configure for the action.

Description: This text will be displayed on the button (or drop-down list) of the source view.
URL: This is the target URL you choose in step 1 above.

Step 3: Create the source view

Create a new view with style set to Bulk Operations. Select "Each action as a separate button", "Skip confirmation step" and the action that you created in step 2 (Note! You should not use the Batch API). Then click "Update default display.

Add a page display to the view and set an appropriate path for it, for instance "products". Click Save.

Help improve this page

Page status: Not set

You can: