Posted by swentel on July 30, 2011 at 10:38pm
| Project: | Chaos tool suite (ctools) |
| Version: | 7.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Use case: you have an image field set to unlimited. But sometimes you only want to show the first (or first two etc).
Patch attached checks the field cardinality on Field API fields. A really handy feature if imo :)
| Attachment | Size |
|---|---|
| field_api_items_limit.patch | 2 KB |
Comments
#1
Subscribe.
#2
Updated patch - form is like in views now, see http://imageshack.us/photo/my-images/850/screenshot20110907at193.png/
Need to test this patch a bit more though, so setting needs work.
#3
Updated again - reverse doesn't work yet though - will figure it out tomorrow.
#4
Ok, this patch should be good.
#5
Thank you for your work on this, I am needing it desperately to avoid clogging up disk space with all of the extra images I am uploading currently. My current set up is to use a completely different image field for the teaser view of my products (at antiquejackpot.com), and this is hopefully going to allow me to get rid of that extra field.
However, I updated CTools this morning, and then applied your patch... For some reason, I am not seeing the extra field(s) to drop in the values of what is to be shown - this is the case for both Colorbox and regular Image fields. I've cleared my local cache, the site cache, and even ran the update.php script. Is there something I'm missing? I can give you anything you need to troubleshoot, just let me know.
Thanks again!
Edit: FYI, this is a Drupal Commerce site if that changes anything...
#6
Crymzyn: I've implemented what you're looking for, try my module: http://thepanz.netsons.org/post/drupal7-image-formatter
Small and clean!
Cheers
#7
thePanz................YOU DID IT!
I have tried Display Suite, Field Multiple Limit, and a number of different solutions, but none of them seemed to play well with Commerce. Now I have exactly what I need - teasers with 1 image!
Thanks so much!
#8
Didn't work if there's no settings form for the field to begin with - attached patch fixes. Otherwise working.
I think I see what you were aiming for with the translations and explode, so I continued down that path.
I'm not sure about the UI. Especially having to type in the word "all" seems a bit confusing, especially as there's no hint about how to get all items to display once you've changed the default to something else.
How about:
Skip the first @count items.Then display at most @count items (enter 0 to display all items).
What do you think?
#9
Same patch as above, but with the alternative UI.
#10
This should be ready.
#11
Committed and pushed!
#12
Automatically closed -- issue fixed for 2 weeks with no activity.