summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/help/select-multple-nids-contextual-filters.html
blob: 433d751cee2bea2d589c21b702d9114cda9bd041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
We assume that you have a properly configured view at this point. You should have a page or block display with fields/node to be displayed in it.

<ol>
<li>In the views administration screen add a new 'contextual filter' using 'add'.  You will see a configuration screen appear as a modal.</li>

<li>In the 'Filter' jump menu that you now see select 'Content'. A list will appear below the jump menu.</li>

<li>In the list look for 'Content: Nid', and check it. </li>

<li>Press the 'Add and configure contextual filters' button.  You will now get the configuration screen for 'Content: Nid'.</li>

<li>Under 'When the filter value is NOT in the URL' select 'Provide default argument', and leave it set at 'Fixed value'.</li>

<li>In the field 'Fixed value' add the Nids of the nodes separated by a '+' that you want to show by default.</li>

<li>In 'When the filter value IS in the URL or a default is provided' choose 'Specify validation criteria'. Now select the content types you want, or leave blank for all nodes.</li>

<li>Check the 'Validate user has access to the node'. This will check if a user has permission to view nodes, that are going to be displayed</li>

<li>For the 'Filter value format' select 'Node IDs separated by , or +'.</li>

<li>Select the MORE link.</li>

<li>Check 'Allow Multiple Terms per Argument' and press 'Apply (all displays
)' (or choose a particular display in the dropdown at the top and Apply (this display)). </li>
</ol>

Preview should now show nodes, that you selected as "default argument". You can now pass arguments to your view, to select custom node IDs. If you provide no argument, default will be used. Save the view when ready.