You are here

README.txt in Field Redirection 7

Same filename and directory in other branches
  1. 8.2 README.txt
  2. 7.2 README.txt
Field Redirection
*****************

A field formatter for Link, Node Reference and User Reference fields that will
perform a HTTP redirect to the given URL, node or user.  Separate formatters
are provided for each of the seven different possible HTTP status codes that
are allowed by the specifications.

Example Usage
*************
The best way of using this module is to create a custom display setting for the
"Full content", pick one of the redirect status codes above, e.g. 301, and hide
all other fields to reduce processing & load time.

To configure the recommended settings:
* Go to the "Manage Display" tab on the settings page for the entity of choice
  (user, content type, etc) settings page, e.g. to work with the content type
  "redirect_user", go to the URL:
  http://example.com/admin/structure/types/manage/redirect_user/display
  (where "example.com" is your site's hostname).
* Expand the "Custom display settings" fieldset and ensure the "Full content"
  checkbox is checked.
* Click the "Save" button.
* Go to the "Full Content" tab.
* Ensure that all of the fields are hidden except for the field you wish to
  use.
* Click the selector in the Format column of the field in question.
* Select the HTTP status code to use for the redirect - see below, though 301
  is usually the best option.
* Click the "Save" button.
* Ensure that other display modes do not use the redirect.

Status codes
************
For completeness sake this module provides all of the allowed HTTP status codes
that are valid for redirection:
* 300 - "multiple choices".
* 301 - "moved permanently" - The best option for most use cases, indicates
  that the current path will not be made available again and links should be
  updated to the new path.
* 302 - "found" - Usually used to indicate a temporary redirect, but also that
  there may be technical problems causing the redirection.
* 303 - "see other".
* 304 - "not modified".
* 305 - "use proxy".
* 307 - "temporary redirect" - Best to use if the path is purposefully only
  being redirected temporarily and this current path will be made available
  for display again at a later time.  If the current path will not be made
  available again it would be better to use status code 301 instead.

The most commonly used are 301 and 307.

Further reading: http://en.wikipedia.org/wiki/URL_redirection

WARNING
*******
This field formatter should *only* be used when displaying the "full content"
of a given entity (user, content type, etc), otherwise unexpected results will
happen.  Example problems that can arise include:
* Using this formatter for a view mode used on the search index could cause
  the search index to never complete, or even cron to never complete.
* Using this formatter in an RSS feed would cause all readers of the RSS feed
  to be instantly redirected to the path provided by this field, rather than
  seeing the feed itself.
* Using this formatter in a teaser would cause any page that displayed this
  entity in its content list, e.g. possibly the site's homepage, to redirect.

Limitations
***********
There are a few known limitations to this module:
* Only one field for a given entity (user, content type, etc) should be
  assigned this formatter.
* The field that is given this formatter should have a maximum number of values
  set to 1.
* It does not make sense to create a Panel node_view display for entities using
  this on a field formatter.

TODO
****
There are a few tasks that would be good to add:
* Provide JavaScript redirection, like the old CCK_Redirection module.
* Provide frameset redirection, like the old CCK_Redirection module.
* Backport to Drupal 6 (seriously).

Attribution
***********
Based on the CCK_Redirection [1] module by Robin Monks [2] for Drupal 5 and 6.
The idea of just providing formatters rather than a fully separate field type
was from user e2thex [3] who suggested the idea during discussion of the
Drupal 7 port of CCK_Redirection [4].

Why a separate module?
**********************
This was written as a separate module rather than an expansion of the D7 port
of CCK_Redirection purely to keep it small & simple, without adding any extra
fields or deal with migration of D6 data.  This is also the reason why seven
different display formatters are provided rather than adding a whole extra
field widget, so the site developer just selects the desired formatter and is
done with it.

Author
******
The current maintainer is DamienMcKenna [5] on behalf of Bluespark Labs [6].


1: http://drupal.org/project/cck_redirection
2: http://drupal.org/user/12246
3: http://drupal.org/user/189123
4: http://drupal.org/node/1098250
5: http://drupal.org/user/108450
6: http://www.bluesparklabs.com/

File

README.txt
View source
  1. Field Redirection
  2. *****************
  3. A field formatter for Link, Node Reference and User Reference fields that will
  4. perform a HTTP redirect to the given URL, node or user. Separate formatters
  5. are provided for each of the seven different possible HTTP status codes that
  6. are allowed by the specifications.
  7. Example Usage
  8. *************
  9. The best way of using this module is to create a custom display setting for the
  10. "Full content", pick one of the redirect status codes above, e.g. 301, and hide
  11. all other fields to reduce processing & load time.
  12. To configure the recommended settings:
  13. * Go to the "Manage Display" tab on the settings page for the entity of choice
  14. (user, content type, etc) settings page, e.g. to work with the content type
  15. "redirect_user", go to the URL:
  16. http://example.com/admin/structure/types/manage/redirect_user/display
  17. (where "example.com" is your site's hostname).
  18. * Expand the "Custom display settings" fieldset and ensure the "Full content"
  19. checkbox is checked.
  20. * Click the "Save" button.
  21. * Go to the "Full Content" tab.
  22. * Ensure that all of the fields are hidden except for the field you wish to
  23. use.
  24. * Click the selector in the Format column of the field in question.
  25. * Select the HTTP status code to use for the redirect - see below, though 301
  26. is usually the best option.
  27. * Click the "Save" button.
  28. * Ensure that other display modes do not use the redirect.
  29. Status codes
  30. ************
  31. For completeness sake this module provides all of the allowed HTTP status codes
  32. that are valid for redirection:
  33. * 300 - "multiple choices".
  34. * 301 - "moved permanently" - The best option for most use cases, indicates
  35. that the current path will not be made available again and links should be
  36. updated to the new path.
  37. * 302 - "found" - Usually used to indicate a temporary redirect, but also that
  38. there may be technical problems causing the redirection.
  39. * 303 - "see other".
  40. * 304 - "not modified".
  41. * 305 - "use proxy".
  42. * 307 - "temporary redirect" - Best to use if the path is purposefully only
  43. being redirected temporarily and this current path will be made available
  44. for display again at a later time. If the current path will not be made
  45. available again it would be better to use status code 301 instead.
  46. The most commonly used are 301 and 307.
  47. Further reading: http://en.wikipedia.org/wiki/URL_redirection
  48. WARNING
  49. *******
  50. This field formatter should *only* be used when displaying the "full content"
  51. of a given entity (user, content type, etc), otherwise unexpected results will
  52. happen. Example problems that can arise include:
  53. * Using this formatter for a view mode used on the search index could cause
  54. the search index to never complete, or even cron to never complete.
  55. * Using this formatter in an RSS feed would cause all readers of the RSS feed
  56. to be instantly redirected to the path provided by this field, rather than
  57. seeing the feed itself.
  58. * Using this formatter in a teaser would cause any page that displayed this
  59. entity in its content list, e.g. possibly the site's homepage, to redirect.
  60. Limitations
  61. ***********
  62. There are a few known limitations to this module:
  63. * Only one field for a given entity (user, content type, etc) should be
  64. assigned this formatter.
  65. * The field that is given this formatter should have a maximum number of values
  66. set to 1.
  67. * It does not make sense to create a Panel node_view display for entities using
  68. this on a field formatter.
  69. TODO
  70. ****
  71. There are a few tasks that would be good to add:
  72. * Provide JavaScript redirection, like the old CCK_Redirection module.
  73. * Provide frameset redirection, like the old CCK_Redirection module.
  74. * Backport to Drupal 6 (seriously).
  75. Attribution
  76. ***********
  77. Based on the CCK_Redirection [1] module by Robin Monks [2] for Drupal 5 and 6.
  78. The idea of just providing formatters rather than a fully separate field type
  79. was from user e2thex [3] who suggested the idea during discussion of the
  80. Drupal 7 port of CCK_Redirection [4].
  81. Why a separate module?
  82. **********************
  83. This was written as a separate module rather than an expansion of the D7 port
  84. of CCK_Redirection purely to keep it small & simple, without adding any extra
  85. fields or deal with migration of D6 data. This is also the reason why seven
  86. different display formatters are provided rather than adding a whole extra
  87. field widget, so the site developer just selects the desired formatter and is
  88. done with it.
  89. Author
  90. ******
  91. The current maintainer is DamienMcKenna [5] on behalf of Bluespark Labs [6].
  92. 1: http://drupal.org/project/cck_redirection
  93. 2: http://drupal.org/user/12246
  94. 3: http://drupal.org/user/189123
  95. 4: http://drupal.org/node/1098250
  96. 5: http://drupal.org/user/108450
  97. 6: http://www.bluesparklabs.com/