You are here

README.txt in Domain Access 5

README file for Domain Navigation

File

domain_nav/README.txt
View source
  1. /**
  2. * @file
  3. * README file for Domain Navigation
  4. */
  5. Domain Access: Navigation
  6. Navigation block and menu options for Domain Access.
  7. CONTENTS
  8. --------
  9. 1. Introduction
  10. 2. Installation
  11. 2.1 Dependencies
  12. 3. Configuration Options
  13. 3.1 Link Paths
  14. 3.2 Link Theme
  15. 3.3 Menu Items
  16. 4. Developer Notes
  17. 4.1 domain_nav_render()
  18. 4.2 hook_domainnav()
  19. ----
  20. 1. Introduction
  21. The Domain Access: Navigation module is a small module that generates
  22. a block of themed HTML with links to the currently available domains used
  23. by your site.
  24. The default implementation is a JavaScript-enabled select form that sends
  25. users to a different domain when selected.
  26. ----
  27. 2. Installation
  28. The Domain Navigation module is included in the Domain Access download.
  29. To install, untar the domain package and place the entire folder in your modules
  30. directory.
  31. The Domain Navigation module does not add any database tables.
  32. ----
  33. 2.1 Dependencies
  34. Domain Navigation requires the Domain Access module be installed and active.
  35. ----
  36. 3. Configuration Options
  37. When active, the Domain Navigation module provides a block for use with your
  38. Drupal themes. By default, this block presents a Javascript-powered
  39. select list.
  40. If you click 'configure' for the block, you can set the block title (which
  41. is empty by default) and control the following behaviors.
  42. ----
  43. 3.1 Link Paths
  44. Indicates whether to link to the home page of each domain or to the active
  45. url on the domain.
  46. If set to 'Link to site home page' (the default option), all links will go to
  47. http://example.com/, http://one.example.com, and so forth, regardless of the
  48. current url.
  49. If set to 'Link to active url,' all links will go to the equivalent url on the
  50. selected domain. That is, if the user is at http://example.com/?q=node, then
  51. lnks will be written to http://one.example.com/?q=node.
  52. NOTE: Linking to the active url may cause Access Denied messages if users link
  53. from a node page, since Domain Access restricts node views to specific domains.
  54. ----
  55. 3.2 Link theme
  56. Indicates how to format the HTML output. There are three options:
  57. - JavaScript select list
  58. Creates a select-list form that uses JavaScript to goto the selected domain.
  59. Requires JavaScript and does not include a submit button.
  60. Note: This is _not_ a drupal-generated form element.
  61. - Menu-style tab links
  62. Creates a list of links formatted like primary tabs, with the active domain
  63. highlighted.
  64. - Unordered list of links
  65. Creates a simple unordered list of links.
  66. ----
  67. 3.3 Menu Items
  68. The Domain Navigation module creates a group of menu items that correspond to
  69. the home pages of your active domains.
  70. By design, the root menu element is disabled, since it is only used to group
  71. the menu items together.
  72. The designed use-case of the menu is for use as Primary or Secondary links. To
  73. enable this feature, use the following steps:
  74. - Go to 'admin/build/menu'
  75. - Find the Navigation => Domain menu item.
  76. - Enable the menu item.
  77. - Assign the menu item to Primary or Secondary links, as desired.
  78. - Save the changes.
  79. - Disable the top-level 'Domain' menu item, but leave the others intact.
  80. Following these steps will display all active subdomains in your Primary or
  81. Secondary links menu.
  82. NOTE: If you wish to disable the menu entirely, but keep the block functions
  83. for this module, you may edit the following line at the top of the module:
  84. define('DOMAIN_NAV_MENU', TRUE);
  85. If you set this value to FALSE before you install the module, the menu items
  86. will not be created. If you have already installed the module, you may also set
  87. this value to FALSE and then navigate to 'admin/build/menu'. Note that updated
  88. module releases will always reset this value to TRUE.
  89. ----
  90. 4. Developer Notes
  91. Some working notes on the module, which can be invoked by other template
  92. or module files.
  93. ----
  94. 4.1 domain_nav_render()
  95. This function allows you to place the themed HTML in your own module,
  96. theme, or block function call.
  97. Just call:
  98. domain_list_render($paths = 0, $style = 'default');
  99. Where $paths is a boolean flag indicating how to write links to other domains:
  100. 0 == link to home page
  101. 1 == link to current url
  102. And $style indicates which theme function to invoke. Default options are:
  103. 'default' == theme_domain_nav_default()
  104. 'menus' == theme_domain_nav_menus()
  105. 'ul' == theme_domain_nav_ul()
  106. ----
  107. 4.2 hook_domainnav()
  108. The domainnav hook allows other modules to add parameters to the $options
  109. array that is passed to theme functions. It is intended for use with
  110. custom theme functions of theme overrides that you may use.
  111. To use the function, implement hook_domainnav($domain). You should return
  112. an array of values to append to $options.
  113. Default parameters are passed in the $domain variable and should not be changed;
  114. these are:
  115. domain_id == the unique identifier of this domain
  116. subdomain == the host path of the url for this domain
  117. sitename == the human-readable name of this domain
  118. path == the link path (a Drupal-formatted path)
  119. active == a boolean flag indicating the currently active domain