You are here

README.txt in Views Argument Substitutions 7

CONTENTS OF THIS FILE
---------------------

  * Introduction
  * Examples
  * Installation
  * Known Issues/Shortcomings
  * Maintainers


INTRODUCTION
------------
Contextual Filters allow a View to be filtered based on arguments passed via URL
or other embedded method (e.g. the View Reference module), but contextual
filters are inflexible compared with normal filters (which allow for "contains,"
"begins with," "ends with," etc.).

This module allows contextual filter arguments to be used as replacement tokens
in filters and table arguments, so that passed-in arguments (such as from URLs
or View Reference fields) can be used as values in normal View filters.


EXAMPLES
--------
To search for a node by title containing some keywords:
  1. Create a new node-based ("Content") View: Go to admin/structure/views/add
     and under "Show", choose "Content".
  2. Add a "Global: Null" Contextual Filter (this step is required to allow the
     view to receive at least 1 argument).
  3. Add a "Content: Title" Filter: Under "Filter Criteria," click "Add."
     Choose "Content: Title," set the "Operator" to "Contains", and set the
     "Value" to "***!1***" (without the quotes). Click "Apply."
  4. Done! Any value passed as the first Contextual Filter argument will be used
     as the value for the Content: Title filter.

To search for nodes containing the same title as a specified node:
  1. Start by completing the example "to search for a node by title containing
     some keywords," as given above.
  2. Edit the "Global: Null" Contextual Filter: Enable "Specify validation
     criteria," and set "Validator" to "Content."
  3. Edit the "Content: Title (contains ***!1***)" filter: Change the "Value"
     from "***!1***" to "***%1***".
  4. Done!  If you pass in a valid NID as the first Contextual Filter argument,
     its title will be used as the search value for the Content: Title filter.

INSTALLATION
------------
Activate the module, then administer a desired View.  Add as many Contextual
Filters as you need filter values (using "Global: Null", if appropriate), then
insert corresponding tokens ("***!1***" for the first value, "***!2***" for the
second, etc.) as filter values.  Additionally, "***%1***" may be used to insert
the title for the first argument (for example, if the argument is a node), and
so on.


KNOWN ISSUES/SHORTCOMINGS
-------------------------
None, so far.


MAINTAINERS
-----------
- jay.dansand (Jay Dansand)

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Examples
  5. * Installation
  6. * Known Issues/Shortcomings
  7. * Maintainers
  8. INTRODUCTION
  9. ------------
  10. Contextual Filters allow a View to be filtered based on arguments passed via URL
  11. or other embedded method (e.g. the View Reference module), but contextual
  12. filters are inflexible compared with normal filters (which allow for "contains,"
  13. "begins with," "ends with," etc.).
  14. This module allows contextual filter arguments to be used as replacement tokens
  15. in filters and table arguments, so that passed-in arguments (such as from URLs
  16. or View Reference fields) can be used as values in normal View filters.
  17. EXAMPLES
  18. --------
  19. To search for a node by title containing some keywords:
  20. 1. Create a new node-based ("Content") View: Go to admin/structure/views/add
  21. and under "Show", choose "Content".
  22. 2. Add a "Global: Null" Contextual Filter (this step is required to allow the
  23. view to receive at least 1 argument).
  24. 3. Add a "Content: Title" Filter: Under "Filter Criteria," click "Add."
  25. Choose "Content: Title," set the "Operator" to "Contains", and set the
  26. "Value" to "***!1***" (without the quotes). Click "Apply."
  27. 4. Done! Any value passed as the first Contextual Filter argument will be used
  28. as the value for the Content: Title filter.
  29. To search for nodes containing the same title as a specified node:
  30. 1. Start by completing the example "to search for a node by title containing
  31. some keywords," as given above.
  32. 2. Edit the "Global: Null" Contextual Filter: Enable "Specify validation
  33. criteria," and set "Validator" to "Content."
  34. 3. Edit the "Content: Title (contains ***!1***)" filter: Change the "Value"
  35. from "***!1***" to "***%1***".
  36. 4. Done! If you pass in a valid NID as the first Contextual Filter argument,
  37. its title will be used as the search value for the Content: Title filter.
  38. INSTALLATION
  39. ------------
  40. Activate the module, then administer a desired View. Add as many Contextual
  41. Filters as you need filter values (using "Global: Null", if appropriate), then
  42. insert corresponding tokens ("***!1***" for the first value, "***!2***" for the
  43. second, etc.) as filter values. Additionally, "***%1***" may be used to insert
  44. the title for the first argument (for example, if the argument is a node), and
  45. so on.
  46. KNOWN ISSUES/SHORTCOMINGS
  47. -------------------------
  48. None, so far.
  49. MAINTAINERS
  50. -----------
  51. - jay.dansand (Jay Dansand)