would it be possible to code a feature which limit the number of nodes inside of taxonomy vocabular/term ???
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | node_limitnumber-710266.patch | 4.19 KB | vkareh |
| #5 | node_limitnumber-710266.patch | 4.75 KB | vkareh |
| #4 | node_limitnumber-710266.patch | 4.4 KB | vkareh |
Comments
Comment #1
jdwfly commentedProbably possible right now with the right conditions... but I am planning on adding that sometime.
Comment #2
jdwfly commentedThis is definitely possible using some custom PHP code, but for now this is going to be postponed.
Comment #3
Weka commentedCan someone suggest how to go about setting up a limit per taxonomy term?
I am working on a community website and was asked by the local art group to configure the site for running a photo competition.
There will be about 10 categories and each user can submit only one photo per category.
I know I can use filefield/image for each category, but in order to make the rating/vote feature work, each photo needs to be a node as all of the voting modules can only work with nodes.
So ideally I would need to configure a content type with a category dropdown and a single image filefield. I could use this module to limit the content type to 10 submissions, but with this approach users still would be able to create more than 1 submission per category.
Any suggestions would be very much appreciated.
Comment #4
vkareh commentedI created a patch that adds this option. When configuring the condition, if the taxonomy module is installed, you will see a drop-down for Taxonomy Term. The rule will be analyzed based on the limit of nodes of the same type that have the specified taxonomy term.
Comment #5
vkareh commentedRe-made the patch using the Patch contributor guide so that it's easier for the maintainer to patch.
Comment #6
Weka commentedThanks for the patch vkareh. I could not get it to work until I realized that my content type was setup to use Content Taxonomy Fields field type. Your patch works fine with the default Taxonomy module form.
Comment #7
Weka commentedGoing through the process of configuring my content type to use the default taxonomy form field was a good reminder why I chose to use CCK content taxonomy field type in the fist place. Drupal's default implementation of the taxonomy field is too limiting.
Would making Node Limit Number work with Content Taxonomy be much more difficult?
Comment #8
vkareh commentedActually, using Content Taxonomy would be a completely different approach, since it then has to account for CCK fields as well. It seems to me that this type of functionality could be done as a sub-module, rather than keeping it part of this one: node_limitnumber_taxonomy, node_limitnumber_cck, etc... I'm thinking using a hooks-based approach, so that we can keep node_limitnumber as pure as possible and have the sub-modules alter the processing workflow.
In any case, you should open a new issue for limiting based on CCK field values (which will work for Content Taxonomy). I can't promise anything, as I'm not the maintainer of this module, but I'll give it a shot.
For now, since the patch applied and works for both of us, I'm marking as RTBC.
Comment #9
vkareh commentedSorry for the extra posting -- I cleaned up the query generation part of the patch. It generates the same query, but it's a nicer, cleaner, coding format.
Comment #10
Weka commentedI just tested the latest patch from #9 and it works as expected.
Good point in #8 vkareh, a sub-module is a good idea. I opened a new issue for that.
#1082424: NLN Sub-module - Allow for Node Limiting Based on CCK Field Values
Thanks.
Comment #11
-Timm- commentedHey,
I have used patch from #9. Now I do see it
in the rules, but it doesn't work for me.
If I say:
after new post
- from type Page
- limit is on term = any (or a term for that mather) max 3
Do
- message
- Redirect
But I do not get any result.
But I reffer to unpatched file and just limit on page (not term on page)
I do get the right result.
What am I doing wrong?
Comment #12
chinita7 commentedsubscribe
Comment #13
panditvarun20 commentedI have a taxonomy term banglore. I want to restrict user that they can not add more than 10 nodes of this taxonomy. How can it be done?