source: sipes/modules_contrib/views_or/README.txt @ 6e81fb4

stableversion-3.0
Last change on this file since 6e81fb4 was 177a560, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agrego el directorio de modulos contribuidos de drupal

  • Propiedad mode establecida a 100644
File size: 2.8 KB
Línea 
1
2Views Or allows Views to combine filters with OR and fields with COALESCE.
3
4
5Combining filters or arguments with OR
6--------------------------------------
7
8By default, each record in a view must match all filters. Sometimes records need
9to be included if they match one or more filters in a list of alternatives.
10Views has the ability to combine filters only with AND. If one filter is false,
11the combined list will be false. Views Or adds the ability to combine blocks of
12filters with OR. If one of the filters in the block is true, the combined block
13will be true.
14
15Views Or provides three filters:
16
17  - Begin alternatives
18
19    Begins a block of alternative filters.
20
21  - Next alternative
22
23    Separates alternative filters in an alternatives block.
24
25  - End alternatives
26
27    Ends a block of alternative filters.
28
29Insert these filters between other filters to create alternatives. For example,
30the following sequence of filters
31
32  - Views Or: Begin alternatives =
33  - Taxonomy: Term ID = Carrot
34  - Views Or: Next alternative =
35  - Taxonomy: Term ID = Elephant
36  - Views Or: End alternatives =
37
38is equivalent to the following logical expression:
39
40  (Taxonomy: Term ID = Carrot) OR (Taxonomy: Term ID = Elephant)
41
42Here is a more advanced example. The following sequence of filters
43
44  - Node: Published True
45  - Views Or: Begin alternatives =
46  - Taxonomy: Term ID = Carrot
47  - Node: Type = Forum topic
48  - Views Or: Next alternative =
49  - Taxonomy: Term ID = Elephant
50  - Node: Type = Story
51  - Views Or: End alternatives =
52  - Node: Post date >= -3 weeks
53
54is equivalent to the following logical expression:
55
56  (Node: Published True) AND (
57    (Taxonomy: Term ID = Carrot AND Node: Type = Forum topic)
58    OR
59    (Taxonomy: Term ID = Elephant AND Node: Type = Story)
60  ) AND (Node: Post date >= -3 weeks)
61
62Arguments can be combined in the same way as filters. By default, when arguments
63are combined, the same arguments will be used for both sets of alternatives. So
64if there are two alternative arguments in a block, the view needs to receive
65only one argument. Uncheck "Share arguments" in the "Views Or: Next alternative"
66argument to allow each set of alternatives receive different arguments from the
67URL.
68
69
70Combining fields with COALESCE
71------------------------------
72
73When using relationships in a view, the same field may appear multiple times.
74Views Or adds the ability to combine multiple fields into one using the COALESCE
75function. The value of the combined field will be taken from the first field
76which contains a value.
77
78Views Or provides two fields:
79
80  - Begin alternatives
81
82    Begins a group of alternative fields.
83
84  - End alternatives
85
86    Ends a group of alternative fields.
87
88Insert other fields between these fields to create a combined field. The title
89and settings of the first field in the group will be used for the combined
90field, even if another field contains the value.
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.