You are here

README.txt in Domain Views 7

README file for Domain Views.

File

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