You are here

README.txt in Safeword 7

********************************************************************
                     D R U P A L    M O D U L E
********************************************************************
Name: Safeword Module
Author: Jeff Eaton <www.angrylittletree.com>
Co-maintainer: Robert Castelo <www.codepositive.com>
Project:  http://drupal.org/project/safeword
Drupal: 7.x
********************************************************************
DESCRIPTION:

It's often useful to provide two versions of a given string: one that's
intended for human viewing and another that's intended for use in database
queries, URLs, and so on. In Drupal, this is generally known as a 'Name' and
'Machine name' pair. Drupal 7 even provides a prefab FormAPI element to simplify
the process of entering these matched pairs.

Safeword exposes a custom FieldAPI field type that stores two strings using the
name/machine name approach. It can be useful when generating PathAuto aliases,
exposing Views arguments, and so on.

One common use is to not give users permission to 'Create and edit URL aliases' and instead give
them access to a Safeword field which uses the node title as it's source. So that users can only
edit a limited part of the path, keeping safe the other parts that your site features may rely on.

Transliteration
If you install the Transliteration module an option will apear on
each field to automatically transliterate the machine-name,
converting non-Roman characters into Roman characters without
accents.

https://drupal.org/project/transliteration


********************************************************************
INSTALLATION:

Note: It is assumed that you have Drupal up and running.  Be sure to
check the Drupal web site if you need assistance.

1. Place the entire directory into your Drupal directory:
   sites/all/modules/


2. Enable the module by navigating to:

   administration > modules

  Click the 'Save configuration' button at the bottom to commit your
  changes.


********************************************************************
USAGE

Add a 'Name/Machine Name' field to a content type and set it's display format.

There are three display formats to choose from:

* 'Human-readable version'
   The text entered, without any modification.

* 'Machine-readable version'
   The text entered, modified to make it suitable as a machine name (spaces stripped out, etc..).
   suitable for use in URL paths.

* 'Machine-readable version wrapped in an acronym tag'
   The text entered, modified to make it suitable as a machine name (spaces stripped out, etc..)
   wrapped in an <acronym> tag.

This module also provides each of these options as a token that can be used in various places.

More info on the Token system:

http://drupal.org/documentation/modules/token

If you need users to enter a machine name for a path, a good Replacement pattern would be:

(--|<[^<>]+>|[^/a-z0-9-])+

This allows '/' as part of the machine name.

The 'Show the complete path' option will display the full path to the node being created/edited
next to the source field of the machine name.







File

README.txt
View source
  1. ********************************************************************
  2. D R U P A L M O D U L E
  3. ********************************************************************
  4. Name: Safeword Module
  5. Author: Jeff Eaton
  6. Co-maintainer: Robert Castelo
  7. Project: http://drupal.org/project/safeword
  8. Drupal: 7.x
  9. ********************************************************************
  10. DESCRIPTION:
  11. It's often useful to provide two versions of a given string: one that's
  12. intended for human viewing and another that's intended for use in database
  13. queries, URLs, and so on. In Drupal, this is generally known as a 'Name' and
  14. 'Machine name' pair. Drupal 7 even provides a prefab FormAPI element to simplify
  15. the process of entering these matched pairs.
  16. Safeword exposes a custom FieldAPI field type that stores two strings using the
  17. name/machine name approach. It can be useful when generating PathAuto aliases,
  18. exposing Views arguments, and so on.
  19. One common use is to not give users permission to 'Create and edit URL aliases' and instead give
  20. them access to a Safeword field which uses the node title as it's source. So that users can only
  21. edit a limited part of the path, keeping safe the other parts that your site features may rely on.
  22. Transliteration
  23. If you install the Transliteration module an option will apear on
  24. each field to automatically transliterate the machine-name,
  25. converting non-Roman characters into Roman characters without
  26. accents.
  27. https://drupal.org/project/transliteration
  28. ********************************************************************
  29. INSTALLATION:
  30. Note: It is assumed that you have Drupal up and running. Be sure to
  31. check the Drupal web site if you need assistance.
  32. 1. Place the entire directory into your Drupal directory:
  33. sites/all/modules/
  34. 2. Enable the module by navigating to:
  35. administration > modules
  36. Click the 'Save configuration' button at the bottom to commit your
  37. changes.
  38. ********************************************************************
  39. USAGE
  40. Add a 'Name/Machine Name' field to a content type and set it's display format.
  41. There are three display formats to choose from:
  42. * 'Human-readable version'
  43. The text entered, without any modification.
  44. * 'Machine-readable version'
  45. The text entered, modified to make it suitable as a machine name (spaces stripped out, etc..).
  46. suitable for use in URL paths.
  47. * 'Machine-readable version wrapped in an acronym tag'
  48. The text entered, modified to make it suitable as a machine name (spaces stripped out, etc..)
  49. wrapped in an tag.
  50. This module also provides each of these options as a token that can be used in various places.
  51. More info on the Token system:
  52. http://drupal.org/documentation/modules/token
  53. If you need users to enter a machine name for a path, a good Replacement pattern would be:
  54. (--|<[^<>]+>|[^/a-z0-9-])+
  55. This allows '/' as part of the machine name.
  56. The 'Show the complete path' option will display the full path to the node being created/edited
  57. next to the source field of the machine name.