Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm trying to use colorbox together with inline (7.x-2.x). What i need is a way to render a image field with multiple values, but somehow be able to choose the image to display (ie. if i attach 3 images on the image field, i want to render just the first image)
I need this as i have a blog content type, with just 1 extra image field with ilimited values, so i can attach lots of images there. Then when i write the blog, i can :
write some text... insert first image... write some more text... insert second image... write some more... insert third image.
Any idea on how to achieve this? Thanks a lot!
Comment | File | Size | Author |
---|---|---|---|
#6 | colorbox_formatter_index_1894114.patch | 1.42 KB | frjo |
#3 | 0001-Added-display-setting-for-handling-multi-valued-fiel.patch | 3.23 KB | Anonymous (not verified) |
Comments
Comment #1
frjo CreditAttribution: frjo commentedI do not understand what you are after regarding the Colorbox module.
Does the inline module have some sort of Colorbox integration or are you asking how to activate Colorbox for images that you insert with the inline module?
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedYeah, inline has integration with any module defined formatters, in branch 7.x-2.x, i can write something like:
Inline renders the field_image contents of the very same node (id=0, in this example) between the first and second paragraphs.
So, i think looking at the colorbox code, i've found i have no option to render just one specific element. The code is at:
http://drupalcode.org/project/colorbox.git/blob/a7239f421e520ccd0ce333b1...
Thise code simply does a foreach for each field element, so i have no option to render just one specific array element.
I hope u understand now. May be somebody can think of a solution to this? I'm thinking of a special value on the $display['settings'] which can be used for limiting the foreach?
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedMy patch adding a display setting for handling multi valued fields. Hope can be reviewed and applied upstream. Cheers!
Comment #4
frjo CreditAttribution: frjo commentedCan you then insert formatter options via the inline tags?
This seems to be a quite special case so I'm hesitant to clutter the UI. I could add "hidden" settings that you can activate by inserting formatter option via other modules.
On the few occasions when I needed this kind of functionality I have used the Insert module. I have added integration with it in the Colorbox module.
http://drupal.org/project/insert
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedYeah, i can add formatter settings on the inline tags (using it right now).
I've implemented the UI part thinking on the usability for non-inline advanced users, also for making it a "standard feature" of colorbox module. But if u can add this without the UI part, great for my use case anyway! Your decision :)
Comment #6
frjo CreditAttribution: frjo commentedWould something like this work for you?
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedAbsolutly! Please push to master. Thanks.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #9
frjo CreditAttribution: frjo commentedCommitted to 7.x-2.x-dev.