You are here

README.txt in URL alter 6

CONTENTS OF THIS FILE
---------------------

 * Introduction
 * Installation
 * Developers
 * Frequently Asked Questions (FAQ)
 * Known Issues
 * More Information
 * How Can You Contribute?


INTRODUCTION
------------

Current Maintainer: Dave Reid <dave@davereid.net>

Utility module that adds new hook_url_alter() hooks for other modules to
implement. Also replaces the need for custom_url_rewrite() functions in
settings.php.


INSTALLATION
------------

See http://drupal.org/getting-started/install-contrib for instructions on
how to install or update Drupal modules.

If your site has custom_url_rewrite functions in your site's settings.php, you
should remove them before installing the module. It should warn you if you have
the functions needing removal. Once you've removed the functions, you should
enter the code from inside the functions into the URL alter module settings at
admin/settings/url-alter.


DEVELOPERS
----------

Instead of implementing custom_url_rewrite_outbound() and
custom_url_rewrite_inbound(), your module should implement hook_url_*_alter().
This will make your modules compatible with other modules that need to rewrite
paths. For the hook documentation, see the include url_alter.api.php.

You can even write your code so that url_alter is used if it is active,
otherwise fallback to the custom_url_rewrite equivalents. For example put the
following code in your module's .module file. Adjust appropriately for
custom_url_rewrite_inbound().

// Define the custom_url_rewrite_outbound() function if not already defined.
if (!function_exists('custom_url_rewrite_outbound')) {
  function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
    mymodule_url_outbound_alter($path, $options, $original_path);
  }
}

/**
 * Implementation of hook_url_outbound_alter().
 */
function mymodule_url_outbound_alter(&$path, &$options, $original_path) {
  // Perform your alterations here.
}


FREQUENTLY ASKED QUESTIONS (FAQ)
--------------------------------

Q: What if I have my own custom_url_rewrite functions in my settings.php?
A: URL alter will not work unless you remove those functions. Luckily, you can
   copy the code inside those functions and paste them into the URL alter
   module settings (admin/settings/url-alter).

Q: Help! I put in invalid PHP code in admin/settings/url-alter!
A: If you add ?url-alter-kill to any URL on your site, it should temporarily
   disable the module. The PHP code will always be prevented from running on
   admin/settings/url-alter so you can always fix your PHP code on that page.


KNOWN ISSUES
------------

- There are no known issues at this time.


MORE INFORMATION
----------------

- To issue any bug reports, feature or support requests, see the module issue
  queue at http://drupal.org/project/issues/url_alter.


HOW CAN YOU CONTRIBUTE?
---------------------

- Write a review for this module at drupalmodules.com.
  http://drupalmodules.com/module/url-alter

- Help translate this module.
  http://localize.drupal.org/translate/projects/url_alter

- Report any bugs, feature requests, etc. in the issue tracker.
  http://drupal.org/project/issues/url_alter

- Contact the maintainer with any comments, questions, or feedback.
  http://davereid.net/contact

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Installation
  5. * Developers
  6. * Frequently Asked Questions (FAQ)
  7. * Known Issues
  8. * More Information
  9. * How Can You Contribute?
  10. INTRODUCTION
  11. ------------
  12. Current Maintainer: Dave Reid
  13. Utility module that adds new hook_url_alter() hooks for other modules to
  14. implement. Also replaces the need for custom_url_rewrite() functions in
  15. settings.php.
  16. INSTALLATION
  17. ------------
  18. See http://drupal.org/getting-started/install-contrib for instructions on
  19. how to install or update Drupal modules.
  20. If your site has custom_url_rewrite functions in your site's settings.php, you
  21. should remove them before installing the module. It should warn you if you have
  22. the functions needing removal. Once you've removed the functions, you should
  23. enter the code from inside the functions into the URL alter module settings at
  24. admin/settings/url-alter.
  25. DEVELOPERS
  26. ----------
  27. Instead of implementing custom_url_rewrite_outbound() and
  28. custom_url_rewrite_inbound(), your module should implement hook_url_*_alter().
  29. This will make your modules compatible with other modules that need to rewrite
  30. paths. For the hook documentation, see the include url_alter.api.php.
  31. You can even write your code so that url_alter is used if it is active,
  32. otherwise fallback to the custom_url_rewrite equivalents. For example put the
  33. following code in your module's .module file. Adjust appropriately for
  34. custom_url_rewrite_inbound().
  35. // Define the custom_url_rewrite_outbound() function if not already defined.
  36. if (!function_exists('custom_url_rewrite_outbound')) {
  37. function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
  38. mymodule_url_outbound_alter($path, $options, $original_path);
  39. }
  40. }
  41. /**
  42. * Implementation of hook_url_outbound_alter().
  43. */
  44. function mymodule_url_outbound_alter(&$path, &$options, $original_path) {
  45. // Perform your alterations here.
  46. }
  47. FREQUENTLY ASKED QUESTIONS (FAQ)
  48. --------------------------------
  49. Q: What if I have my own custom_url_rewrite functions in my settings.php?
  50. A: URL alter will not work unless you remove those functions. Luckily, you can
  51. copy the code inside those functions and paste them into the URL alter
  52. module settings (admin/settings/url-alter).
  53. Q: Help! I put in invalid PHP code in admin/settings/url-alter!
  54. A: If you add ?url-alter-kill to any URL on your site, it should temporarily
  55. disable the module. The PHP code will always be prevented from running on
  56. admin/settings/url-alter so you can always fix your PHP code on that page.
  57. KNOWN ISSUES
  58. ------------
  59. - There are no known issues at this time.
  60. MORE INFORMATION
  61. ----------------
  62. - To issue any bug reports, feature or support requests, see the module issue
  63. queue at http://drupal.org/project/issues/url_alter.
  64. HOW CAN YOU CONTRIBUTE?
  65. ---------------------
  66. - Write a review for this module at drupalmodules.com.
  67. http://drupalmodules.com/module/url-alter
  68. - Help translate this module.
  69. http://localize.drupal.org/translate/projects/url_alter
  70. - Report any bugs, feature requests, etc. in the issue tracker.
  71. http://drupal.org/project/issues/url_alter
  72. - Contact the maintainer with any comments, questions, or feedback.
  73. http://davereid.net/contact