You are here

README.txt in Domain Access 6.2

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. 5. Access Plugin
  15. ----
  16. 1. Introduction
  17. The Domain Views module is a small extension to the Domain Access module.
  18. The module requires Views 6.x.2 or higher.
  19. It provides a Views argument and filter for Domain Access. This feature allows
  20. Views to filter content based on the access privlieges set by Domain Access.
  21. This module is most useful for site administrators, who can normally see all
  22. nodes at all times. Using the provided filters can alter this behavior.
  23. This code implements Views integration for the Domain Access module by adding
  24. a Views filter and argument handler. This allows you to restrict your view
  25. content to only show content from a specified domain (or set of domains) either
  26. by using a predefined filter or by passing arguments to the view e.g.
  27. example.com/myview/6 (where 6 is the id for one one of your domains).
  28. ----
  29. 1.1 Authors
  30. This module was written by Drupal user mrichar1. http://drupal.org/user/60123
  31. It was updgraded to Views 2 by nonsie. http://drupal.org/user/29899
  32. See http://drupal.org/node/200714 for the background on this module.
  33. This module is maintained by nonsie as part of the Domain package.
  34. ----
  35. 2. Installation
  36. The Domain Views module comes with the Domain Access download.
  37. To install, you simply enable the module at Admin > Build > Modules.
  38. No database tables are installed and no configuration is required.
  39. ----
  40. 3. Arguments
  41. This module provides a Domain Access argument that can be added to any View.
  42. Arguments can be thought of as "dynamic filters" that are applied to the view at
  43. run-time.
  44. The Domain Views Argument currently accepts two types of arguments:
  45. -- a numerical domain_id
  46. -- the string "current" [without quotation marks]
  47. Assume we have page view that shows a listing of all nodes of node-type "car",
  48. and you enable the "Domain Access" argument type:
  49. -- If you go to www.example.com/cars/3 you will see a listing of all nodes
  50. of type car that are assigned to domain 3.
  51. -- If you go to domain4.example.com/cars/current you will see a listing of
  52. all nodes of type car that are assigned to domain4.
  53. -- If the argument value is not set in your View, it will display the
  54. default view which can be "page not found", a summary view or any of the
  55. other defaults.
  56. You can get the view to filter by the current domain by default by pasting the
  57. following code in "Argument Handling Code" text box . This will cause the view
  58. to always see the id of the current domain as first argument if no argument has
  59. been passed in.
  60. // Make the first argument "current" if it is not already set
  61. if (!$args[0]) {
  62. $args[0] = 'current';
  63. }
  64. return $args;
  65. For more on Views Arguments, see the documentation on argument handlers for
  66. views at:
  67. http://drupal.org/node/54455.
  68. ----
  69. 4. Filters
  70. Using the Domain Access filter lets you restrict a View to only content assigned
  71. to the selected domains.
  72. However, for users without the 'administer nodes' permission, the content must
  73. be viewable on the active domain. If you wish to make all content in the View
  74. available to all domains, you should configure the 'Special page requests'
  75. setting provided by the Domain Access module.
  76. When using Views filters, you must select at least one criteria for the filter
  77. to be applied.
  78. The filters available to Domain Access include all active domains plus currently
  79. active domain.
  80. ----
  81. 5. Access Plugin
  82. Domain Views offers an access plugin to all Views that allow you to select
  83. on which domains a View may be accessed. There are three settings to consider.
  84. -- The domain(s) on which the content should be available.
  85. -- Whether the user can access content on the active domain. This setting
  86. mirrors the behavior of the Domain Strict module in that it gathers the
  87. data from hook_node_grants() before appying access rules.
  88. -- Whether the user is assigned to the active domain. This setting can be
  89. used to provide members-only or editors-only Views. This setting is more
  90. liberal than the strict setting, and they two may be used at the same time.
  91. This access setting is valuable for cases where certain Views are not appropriate
  92. on all domains.