You are here

README.txt in Domain Access 5

README file for Domain Views.

File

domain_views/README.txt
View source
  1. /**
  2. * @file
  3. * README file for Domain Views.
  4. */
  5. Domain Views
  6. Provides a Views filter for the Domain Access module.
  7. CONTENTS
  8. --------
  9. 1. Introduction
  10. 1.1 Authors
  11. 2. Installation
  12. 3. Arguments
  13. 4. Filters
  14. ----
  15. 1. Introduction
  16. The Domain Views module is a small extension to the Domain Access module.
  17. It provides a Views argument and filter for Domain Access. This feature allows
  18. Views to filter content based on the access privlieges set by Domain Access.
  19. This module is most useful for site administrators, who can normally see all
  20. nodes at all times. Using the provides filters can alter this behavior.
  21. This code implements views integration for the Domain Access module by adding
  22. a views filter and argument handler. This allows you to restrict your view content
  23. to only show content from a specified domain (or set of domains) either by using
  24. a predefined filter or by passing arguments to the view e.g. example.com/myview/6
  25. (where 6 is the id for one one of your domains).
  26. ----
  27. 1.1 Authors
  28. This module was written by Drupal user mrichar1. http://drupal.org/user/60123
  29. See http://drupal.org/node/200714 for the background on this module.
  30. This module is maintained by agentrickard as part of the Domain package.
  31. ----
  32. 2. Installation
  33. The Domain Views module comes with the Domain Access download.
  34. To install, you simply enable the module at Admin > Build > Modules.
  35. No database tables are installed and no configuration is required.
  36. ----
  37. 3. Arguments
  38. This module provides a Domain Access argument that can be added to any View.
  39. Arguments can be thought of as "dynamic filters" that are applied to the view at run-time.
  40. The Domain Views Argument currently accepts two types of arguments:
  41. -- a numerical domain_id
  42. -- the string "current" [without quotation marks]
  43. Assume we have page view that shows a listing of all nodes of node-type "car", and
  44. you enable the "Domain Access" argument type:
  45. -- If you go to www.example.com/cars/3 you will see a listing of all nodes of type
  46. car that are assigned to domain 3.
  47. -- If you go to domain4.example.com/cars/current you will see a listing of all nodes of
  48. type car that are assigned to domain4.
  49. -- If the argument value is not set in your View, it will display the default view which can
  50. be "page not found", a summary view or any of the other defaults.
  51. You can get the view to filter by the current domain by default by pasting the following
  52. code in "Argument Handling Code" text box . This will cause the view to always see the id of
  53. the current domain as first argument if no argument has been passed in.
  54. // Make the first argument "current" if it is not already set
  55. if (!$args[0]) {
  56. $args[0] = 'current';
  57. }
  58. return $args;
  59. For more on Views Arguments, see the documentation on argument handlers for views at:
  60. http://drupal.org/node/54455.
  61. ----
  62. 4. Filters
  63. Using the Domain Access filter lets you restrict a View to only content assigned
  64. to the selected domains.
  65. However, for users without the 'administer nodes' permission, the content must
  66. be viewable on the active domain. If you wish to make all content in the View
  67. available to all domains, you should configure the 'Special page requests'
  68. setting provided by the Domain Access module.
  69. When using Views filters, you must select at least one criteria for the filter to
  70. be applied.