| 1 |
// $Id: README.txt,v 1.4 2007/01/04 05:46:47 codexmas Exp $
|
| 2 |
----------------------------------------------------------------
|
| 3 |
|
| 4 |
This module allows an admin to set limits on the number of terms that a node
|
| 5 |
can have per vocabulary. It also allows setting this per content type as
|
| 6 |
well. For example, a page could allow unlimited terms in a category, but a
|
| 7 |
story could limit the same category to four choices.
|
| 8 |
|
| 9 |
Settings for this module are in admin/settings/taxonomy_limit
|
| 10 |
|
| 11 |
The settings page does attempt to be as informative as possible regarding the
|
| 12 |
choices you make. There are redundant checks for the categories you select so
|
| 13 |
that changes to how the category is configured don't cause errors.
|
| 14 |
|
| 15 |
This module requires categories to have the multiple option enabled.
|
| 16 |
Freetagging categories are supported and have this option enabled implicitly.
|
| 17 |
|
| 18 |
Upgrading from Drupal 5
|
| 19 |
-----------------------
|
| 20 |
|
| 21 |
Older versions of this module stored error messages differently (in the same
|
| 22 |
variable as the taxonomy limit). This has been changed to allow users to
|
| 23 |
translate error messages. As a result, you will need to reset your custom
|
| 24 |
error messages after upgrading.
|
| 25 |
|
| 26 |
Ideally this would be handled via an upgrade hook. Patches for this would be
|
| 27 |
very welcome.
|
| 28 |
|
| 29 |
Translating Error Messages
|
| 30 |
--------------------------
|
| 31 |
|
| 32 |
Like taxonomy limits, error messages are set per vocabulary and content type.
|
| 33 |
They are stored as Drupal variables and so can be translated by declaring them
|
| 34 |
to be multilingual variables. To do this, first install the
|
| 35 |
Internationalization module (i18n). Next, for each content type whose error
|
| 36 |
messages you wish to translate, add the variable 'taxonomy_limit_type_error'
|
| 37 |
to the $conf['i18n_variables'] in settings.php, where 'type' is the content
|
| 38 |
type. Note that you must use Drupal's internal type name (the 'Type' column
|
| 39 |
at admin/content/types) and not the human-readable type name (the 'Name'
|
| 40 |
column at the above page).
|
| 41 |
|
| 42 |
For example, to translate error messages for the story and page content types,
|
| 43 |
you would add this to settings.php:
|
| 44 |
|
| 45 |
$conf['i18n_variables'] = array(
|
| 46 |
'taxonomy_limit_story_error',
|
| 47 |
'taxonomy_limit_page_error',
|
| 48 |
);
|
| 49 |
|
| 50 |
Finally, load the taxonomy limit settings page while the site is set to each
|
| 51 |
language you have enabled, and enter the appropriate translation of your error
|
| 52 |
message. Note that you will also need to reset the error message for the
|
| 53 |
site's default language (this is a consequence of how multilingual variables
|
| 54 |
work and is not specific to this module.)
|
| 55 |
|
| 56 |
For more information on multilingual variables, see this handbook page:
|
| 57 |
http://drupal.org/node/313272
|
| 58 |
|
| 59 |
Contributors
|
| 60 |
------------
|
| 61 |
|
| 62 |
Gord Christmas (Drupal 4.7 & 5)
|
| 63 |
http://drupal.org/user/40977
|
| 64 |
gord@northstudio.com
|
| 65 |
http://www.northStudio.com/
|
| 66 |
|
| 67 |
Matt Corks (Drupal 6)
|
| 68 |
http://drupal.org/user/15016
|
| 69 |
mattc@openflows.com
|
| 70 |
http://www.openflows.com/
|