You are here

README.txt in Domain Access 6.2

README file for Domain Conf

File

domain_conf/README.txt
View source
  1. /**
  2. * @file
  3. * README file for Domain Conf
  4. */
  5. Domain Access: Site Configuration
  6. Advanced site configuration options for Domain Access.
  7. CONTENTS
  8. --------
  9. 1. Introduction
  10. 1.1 Use-Case
  11. 1.2 Example
  12. 2. Installation
  13. 2.1 Dependencies
  14. 2.2 Configuration Options
  15. 2.3 Menu Blocks
  16. 3. Batch Updates
  17. 4. Developer Notes
  18. 4.1 Extending Options with hook_domainconf()
  19. 4.2 Setting Variables for Domains
  20. 4.3 Using domain_conf.inc
  21. 4.4 Database Schema
  22. ----
  23. 1. Introduction
  24. The Domain Access: Site Configuration module (called Domain Conf), is an
  25. optional extension of the Domain Access module. Domain Conf provides options
  26. for configuring basic settings of your affiliate sites to be different.
  27. ----
  28. 1.1 Use-Case
  29. In the original build for the Domain Access module, we had a problem. Most
  30. of our affiliates were on the East coast of the U.S. But a few were further
  31. West, in different time zones.
  32. Using a single time zone configuration for all affiliates simply would not work.
  33. So the Domain Conf module was written as an optional extension for Domain
  34. Access.
  35. This module allows each affiliate site to set specific configuration options,
  36. which will override the default site settings as needed. See section 2.2 for
  37. more details.
  38. ----
  39. 1.2 Example
  40. For an example, see http://skirt.com/map. Note that some of the affiliates
  41. may be in "offline" mode. This is accomplished using the Domain Conf module.
  42. ----
  43. 2. Installation
  44. The Domain Conf module is included in the Domain Access download. To install,
  45. untar the domain package and place the entire folder in your modules directory.
  46. When you enable the module, it will create a {domain_conf} table in your Drupal
  47. database.
  48. For the module to function correctly, you must follow the instructions in INSTALL.txt.
  49. ----
  50. 2.1 Dependencies
  51. Domain Conf requires the Domain Access module be installed and active.
  52. ----
  53. 2.2 Configuration Options
  54. When active, the Domain Conf module provides a 'settings' link next to each
  55. entry in your Domain Acccess list (found at path 'admin/build/domain/list').
  56. For each registered domain, you have the option of saving settings that will
  57. replace the system settings for your root site. The currently available
  58. settings are:
  59. - Name of site
  60. - E-mail address
  61. - Slogan
  62. - Mission
  63. - Footer message
  64. - Default front page
  65. - Anonymous user
  66. - Administrative theme
  67. - Default menu for content (if Menu module is used)
  68. - Primary links menu (if Menu module is used)
  69. - Secondary links menu (if Menu module is used)
  70. - Default time zone
  71. - Default language (if Locale module is used)
  72. - Caching mode
  73. - Minimum cache lifetime
  74. - Page compression
  75. - Site status
  76. - Site off-line message
  77. On page load, these values are dynamically loaded to replace your site's
  78. defaults. If you do not adjust these settings, defaults will be used for all
  79. affiliates.
  80. ----
  81. 2.3 Menu Blocks
  82. This section only applies if you set separate Primary or Secondary links
  83. for your domains.
  84. Drupal's default blocks for Primary and Secondary links do not respect
  85. the variables set by Domain Configuration. To work around this limitation,
  86. we instead create two new blocks, named:
  87. -- Domain primary links
  88. -- Domain secondary links
  89. These blocks respond to domain-specific settings and may be used instead
  90. of (or in addition to) the default Primary and Secondary links blocks.
  91. ----
  92. 3. Batch Updates
  93. Domain Conf allows you to make batch changes to settings for all domains.
  94. All of the current settings are available in batch mode.
  95. You may also choose to remove domain-specific configurations. This feature
  96. is useful if you wish to roll back custom changes.
  97. NOTE: If you make batch changes from a domain other than the primary
  98. domain, the default variable value may be taken from the active domain.
  99. Be sure to check the values in this form before saving.
  100. ----
  101. 4. Developer Notes
  102. The Domain Conf module is the model for extending Domain Acccess.
  103. The following form elements were removed during beta testing:
  104. - File system path
  105. - Temporary directory
  106. See http://drupal.org/node/197692 for the reasons.
  107. ----
  108. 4.1 Extending Options with hook_domainconf()
  109. The module works by applying hook_form_alter() to the form:
  110. 'system_settings_form' and then adding addiitonal fields from other forms.
  111. hook_domainconf() allows developers to add additional form elements.
  112. Note that you may use this hook to create variables that are independent
  113. of other Drupal modules. To do so, be sure to set the '#domain_setting' flag
  114. to TRUE before returning your $form array.
  115. - $form['myform']['#domain_setting'] = TRUE;
  116. Please see the full documentation in the API.
  117. http://therickards.com/api/function/hook_domainconf/Domain
  118. ----
  119. 4.2 Setting Variables for Domains
  120. If you need to change the value of a domain-specific setting from another
  121. module, you can now use the function domain_conf_variable_set().
  122. domain_conf_variable_set($domain_id, $variable, $value = NULL)
  123. Complete documentation of this function is in API.php.
  124. ----
  125. 4.3 Using domain_conf.inc
  126. The normal method for using hook_domainconf() is to have the hook implemented
  127. in other modules.
  128. However, the community development process may mean that it will take time for
  129. the hook to be implemented in modules that you may be using.
  130. To allow for this fact without harming the upgrade path for Domain
  131. Configuration, it is possible to create a domain_conf.inc file that you place
  132. inside the domain_conf directory.
  133. This file should be a PHP file, and it should conform to Drupal coding
  134. standards.
  135. For example, to add the user picture default setting to the module without
  136. patching user.module or domain_conf.module, you may create the following
  137. file:
  138. ====
  139. /**
  140. * Implement hook_domainconf() to add the user picture.
  141. */
  142. function user_domainconf() {
  143. $form['pictures'] = array(
  144. '#type' => 'fieldset',
  145. '#title' => t('User picture'),
  146. '#collapsible' => TRUE,
  147. '#collapsed' => FALSE,
  148. );
  149. $form['pictures']['user_picture_default'] = array(
  150. '#type' => 'textfield',
  151. '#title' => t('Default picture'),
  152. '#default_value' => variable_get('user_picture_default', ''),
  153. '#size' => 30,
  154. '#maxlength' => 255,
  155. '#description' => t('URL of picture to display for users with no custom
  156. picture selected. Leave blank for none.')
  157. );
  158. return $form;
  159. }
  160. ====
  161. NOTE: Before upgrading the Domain module, be sure to save this file
  162. so that it may be replaced in the event it is deleted. Note also that the
  163. domain_conf.inc file is not included in the module package.
  164. See http://drupal.org/node/236877 for additional background.
  165. ----
  166. 4.4 Database Schema
  167. Installing the module creates a {domain_conf} table that contains:
  168. - domain_id
  169. Integer, unique
  170. The lookup key for this record, foreign key to the {domain} table.
  171. - settings
  172. Blob (bytea)
  173. A serialized array of settings for this domain.