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 :)

AttachmentSize
field_api_items_limit.patch2 KB

Comments

#1

Subscribe.

#2

Status:needs review» needs work

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.

AttachmentSize
1234618.patch 3.35 KB

#3

Updated again - reverse doesn't work yet though - will figure it out tomorrow.

AttachmentSize
1234618.patch 3.39 KB

#4

Status:needs work» needs review

Ok, this patch should be good.

AttachmentSize
1234618.patch 3.44 KB

#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?
AttachmentSize
1234618.patch 3.36 KB

#9

Same patch as above, but with the alternative UI.

AttachmentSize
1234618.patch 3.31 KB

#10

Status:needs review» reviewed & tested by the community

This should be ready.

#11

Status:reviewed & tested by the community» fixed

Committed and pushed!

#12

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.