You are here

README.txt in Views Global Filter 6

Same filename and directory in other branches
  1. 8 README.txt
  2. 7 README.txt
GLOBAL FILTER CONFIGURATION (6.x)
=================================
A global filter can be either a node property/field or a view.

The 6.x version fully supports Views but as far as fields go, only the common
node properties (e.g. type etc.), not CCK fields, yet.

When using a view be aware that it will be the first item under the Fields
heading that will populate the filter drop-down, so re-order your items if
necessary. The remaining items will be ignored. The view does not need to have a
page or block display associated with it and may even be disabled -- it will
still operate correctly as a global filter.

0) You normally use this module in the context of Views, so enable that module
together with Global Filter.

1) A couple of filter blocks, named "Global filter 1" and "Global filter 2" will
now be available on the Blocks page. Click "configure" to select the field
you want to employ to populate the global drop-down. Note that the drop-down
will be a text box, if the field does not represent a list, radio buttons,
check box or vocabulary, i.e. a number or text. Place the block or blocks
anywhere on your site.
If you want to use more than two global filters, you can create more filter
blocks at Configuration >> Global Filter.

2) You can use either a node property or the output of a view as a global
filter. Use the radio buttons on the block configuration page to select which
one. If none of the node properties match what you're after (eg a taxonomy term)
use a view. When using a view make sure that the first field of the view you
create is the one whose values should appear in the filter drop-down, e.g. user
name, content type etc.
In D6 also include the base field, i.e. nid for nodes, uid for users etc.,
unless your view type is "Term", in which case you don't have to output any
fields at all (but it won't hurt if you do).

3) With the global drop-down in place, you can now use it as the default
argument value in any number of views that you want to pass the filter to. On
the View edit page, under Arguments, add and tick the option corresponding to
the global filter source in the previous step. If you created a Term view in
step 2, then select the "Taxonomy: Term ID" argument, not "Taxonomy: Term" (i.e
not the term name).
After pressing "Add", on the next panel, select the radio button "Provide
default value".

3a) When in step 2 you chose a node property as the source for the global
filter, select the Argument type radio button "Global filter (field)".
3b) When you chose a View as the source for the global filter, select radio
button "Global filter (view)" and then select the View driving this filter.

4) Update. Ignore the warning: "Cannot modify header information - headers
already sent...". Press Save.

That's all. Repeat steps 3) and 4) for the remaining Views that need to use the
global filter.

The initial filter selection will be the first in the list, i.e. 'all', unless
you configured the block to have no 'all' option.

By default each drop-down filter comes with a Set button to activate the
selection. However if you tick the appropriate checkbox on the Configuration >>
Global Filter page, the Set button does not appear and the filter is activated
immediately upon release of the mouse.


USEFUL VIEW OPTIONS
===================
On the View edit page, in the Arguments configuration panel, after you have
selected Global filter block to provide the default value, scroll down the panel
for a couple of additional useful options.
"Allow multiple values" is handy when your global filter is a vocabulary. If
this box is ticked, then when the global filter vocabulary has a parent-child
hierarchy, selecting a parent (e.g Europe) will also automatically match any of
its children (eg France, Germany, etc.).
"Exclude is nice to populate a view with the compliment of the global filter
selection (e.g. all countries except European countries).


ADVANCED OPTIONS: ROTATING BLOCK CONTENT
========================================
A special auto-cycle filter is available under the "Advanced configuration"
fieldset on the Configuration >> Global Filter page. You can use this to create
rotating block content, such as ads, news flashes or user profile pictures, that
have to follow a specific logical sequence, for instance chronological (e.g. by
creation or modification date), alphabetical or by vocabulary term order.

You need two views, let's call these the filter view and the block view.

The filter view simply needs to return, in the desired order, the nodes (or
users or...) that you wish to rotate through the block. This view does not need
page or block displays and does not have to output any fields other than the
base field, i.e the nid (or uid or...). However, to verify the view correctly
returns the output in the order you wish them to cycle through the block, we
suggest to configure the style settings to output titles, at least while
testing. Save.
We will now activate the view as the driver for the auto-cycle filter at Site
Configuration >> Global Filter, opening the "Advanced configuration" fieldset.
Select the view you've just created and press "on every page load".

The block view needs to produce at least as much content as the filter view. In
fact you could start by cloning the filter view and use it as a base. Select any
display format and any fields you like to display for the block of rotating
content. Don't forget to add a block display to this view! Remember that only
only of these pieces of content will be shown in the block at any one time, as
auto-selected by the above filter view. This is established by adding an
Argument (upper right corner). Tick "Node: Nid" and "Add". On the next panel
press "Provide default value" and then select "Global filter (view)" from the
Argument type radios. Your auto-cycle view should appear in the next drop-down.
Press Update. Ignore the warning: "Cannot modify header information - headers
already sent...". Press Save.

Finally on the Blocks page, move your block from the Disabled section into
the desired page region. Verify the block appears and note that with every new
page you visit it gets populated with another piece of content from your block
view.

File

README.txt
View source
  1. GLOBAL FILTER CONFIGURATION (6.x)
  2. =================================
  3. A global filter can be either a node property/field or a view.
  4. The 6.x version fully supports Views but as far as fields go, only the common
  5. node properties (e.g. type etc.), not CCK fields, yet.
  6. When using a view be aware that it will be the first item under the Fields
  7. heading that will populate the filter drop-down, so re-order your items if
  8. necessary. The remaining items will be ignored. The view does not need to have a
  9. page or block display associated with it and may even be disabled -- it will
  10. still operate correctly as a global filter.
  11. 0) You normally use this module in the context of Views, so enable that module
  12. together with Global Filter.
  13. 1) A couple of filter blocks, named "Global filter 1" and "Global filter 2" will
  14. now be available on the Blocks page. Click "configure" to select the field
  15. you want to employ to populate the global drop-down. Note that the drop-down
  16. will be a text box, if the field does not represent a list, radio buttons,
  17. check box or vocabulary, i.e. a number or text. Place the block or blocks
  18. anywhere on your site.
  19. If you want to use more than two global filters, you can create more filter
  20. blocks at Configuration >> Global Filter.
  21. 2) You can use either a node property or the output of a view as a global
  22. filter. Use the radio buttons on the block configuration page to select which
  23. one. If none of the node properties match what you're after (eg a taxonomy term)
  24. use a view. When using a view make sure that the first field of the view you
  25. create is the one whose values should appear in the filter drop-down, e.g. user
  26. name, content type etc.
  27. In D6 also include the base field, i.e. nid for nodes, uid for users etc.,
  28. unless your view type is "Term", in which case you don't have to output any
  29. fields at all (but it won't hurt if you do).
  30. 3) With the global drop-down in place, you can now use it as the default
  31. argument value in any number of views that you want to pass the filter to. On
  32. the View edit page, under Arguments, add and tick the option corresponding to
  33. the global filter source in the previous step. If you created a Term view in
  34. step 2, then select the "Taxonomy: Term ID" argument, not "Taxonomy: Term" (i.e
  35. not the term name).
  36. After pressing "Add", on the next panel, select the radio button "Provide
  37. default value".
  38. 3a) When in step 2 you chose a node property as the source for the global
  39. filter, select the Argument type radio button "Global filter (field)".
  40. 3b) When you chose a View as the source for the global filter, select radio
  41. button "Global filter (view)" and then select the View driving this filter.
  42. 4) Update. Ignore the warning: "Cannot modify header information - headers
  43. already sent...". Press Save.
  44. That's all. Repeat steps 3) and 4) for the remaining Views that need to use the
  45. global filter.
  46. The initial filter selection will be the first in the list, i.e. 'all', unless
  47. you configured the block to have no 'all' option.
  48. By default each drop-down filter comes with a Set button to activate the
  49. selection. However if you tick the appropriate checkbox on the Configuration >>
  50. Global Filter page, the Set button does not appear and the filter is activated
  51. immediately upon release of the mouse.
  52. USEFUL VIEW OPTIONS
  53. ===================
  54. On the View edit page, in the Arguments configuration panel, after you have
  55. selected Global filter block to provide the default value, scroll down the panel
  56. for a couple of additional useful options.
  57. "Allow multiple values" is handy when your global filter is a vocabulary. If
  58. this box is ticked, then when the global filter vocabulary has a parent-child
  59. hierarchy, selecting a parent (e.g Europe) will also automatically match any of
  60. its children (eg France, Germany, etc.).
  61. "Exclude is nice to populate a view with the compliment of the global filter
  62. selection (e.g. all countries except European countries).
  63. ADVANCED OPTIONS: ROTATING BLOCK CONTENT
  64. ========================================
  65. A special auto-cycle filter is available under the "Advanced configuration"
  66. fieldset on the Configuration >> Global Filter page. You can use this to create
  67. rotating block content, such as ads, news flashes or user profile pictures, that
  68. have to follow a specific logical sequence, for instance chronological (e.g. by
  69. creation or modification date), alphabetical or by vocabulary term order.
  70. You need two views, let's call these the filter view and the block view.
  71. The filter view simply needs to return, in the desired order, the nodes (or
  72. users or...) that you wish to rotate through the block. This view does not need
  73. page or block displays and does not have to output any fields other than the
  74. base field, i.e the nid (or uid or...). However, to verify the view correctly
  75. returns the output in the order you wish them to cycle through the block, we
  76. suggest to configure the style settings to output titles, at least while
  77. testing. Save.
  78. We will now activate the view as the driver for the auto-cycle filter at Site
  79. Configuration >> Global Filter, opening the "Advanced configuration" fieldset.
  80. Select the view you've just created and press "on every page load".
  81. The block view needs to produce at least as much content as the filter view. In
  82. fact you could start by cloning the filter view and use it as a base. Select any
  83. display format and any fields you like to display for the block of rotating
  84. content. Don't forget to add a block display to this view! Remember that only
  85. only of these pieces of content will be shown in the block at any one time, as
  86. auto-selected by the above filter view. This is established by adding an
  87. Argument (upper right corner). Tick "Node: Nid" and "Add". On the next panel
  88. press "Provide default value" and then select "Global filter (view)" from the
  89. Argument type radios. Your auto-cycle view should appear in the next drop-down.
  90. Press Update. Ignore the warning: "Cannot modify header information - headers
  91. already sent...". Press Save.
  92. Finally on the Blocks page, move your block from the Disabled section into
  93. the desired page region. Verify the block appears and note that with every new
  94. page you visit it gets populated with another piece of content from your block
  95. view.