Posted by jamesmcd on May 28, 2009 at 2:12pm
2 followers
Jump to:
| Project: | Tag Trap |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I am seeking a set up that allows me to specify tags and those tags only say for example on a job site: Management, Secretarial, Accounts, Customer Relations, etc rather than specify tags that are not allowed. Could this be incorporated or would it require development as a separate module?
Comments
#1
I think you can do this with taxonomy already. Just create a vocabulary, check mark the content types to which the vocab is applicable, then check mark "Multiple select" and click the "Save" button. Then on the next screen click "add terms". From there, you can add your own terms. This will limit users to a certain few terms to choose from. This allows you to control what ones they can choose from.
#2
Brilliant thanks, I'll give it a go!
#3
This is exactly what I was after thank you, it worked!
I am however also seeking something similar to that Tag Editor http://drupal.org/project/tag_editor
I require a user to enter his preferred job type, perhaps with more than one vocabulary (I am aware Tag Editor only supports 1 vocabulary at present)
but only on the specific predefined terms. Other terms would not be allowed
Is this possible to set up, or would it require a new module development?
I would much prefer this visually to that of the usual list, which involves highlighting your chosen terms.
Thanks
#4
Well Tag Editor isn't my project so I can't do much about making Tag Editor work on more than one vocabulary. I can say, though, that if you really want to use free-tagging on your vocabularies but still restrict to a certain few terms, you can write a fairly simple regular expression string that uses negative logic. Think of it this way... the regular expression
/[jupiter|saturn|uranus|neptune]/will match any term that is either "Jupiter", "Saturn", "Uranus", or "Neptune" which will in turn cause the node creation or editing process to fail at validation. But suppose you ONLY wanted "Jupiter", "Saturn", "Uranus", or "Neptune" submitted with the node. This is simple to achieve because regular expressions follow the basic rules of logic, one of those rules being negation. To negate a regular expression, we use the caret symbol which looks like this:^. So now if we negate our regular expression example, we'll be saying that we want to fail validation if any of the terms are NOT one of "Jupiter", "Saturn", "Uranus", or "Neptune". Our regular expression will look like this:/[^jupiter|saturn|uranus|neptune]/.You could take this regular expression example and fix it up to work for you, so that it only matches, say: "Secretarial", "Public Relations", "Managerial", "Custodial", "Financial", or "Technical" (and many others).
I don't know if this answers your question-- maybe it over-answers it a bit. I tried to design this module so that it's easy to extend to your own purposes and the regular expressions component is the key because it gives the user almost complete control over how it matches.
If you don't know how regular expressions work, here are a few good links:
If you have any more questions about Tag Trap, I'd be glad to help as best I can. :)