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.
Its a great module,
Would you also consider the module work with CCK imagefield? or is there a way around to do so?
thanks
Comment | File | Size | Author |
---|---|---|---|
#54 | galleria-fix_empty-342708-53.patch | 1.22 KB | Mark Theunissen |
#50 | galleria.png | 202.85 KB | TheAlienShore |
#37 | galleria_imagefield_2.patch | 6.4 KB | eromba |
#31 | galleriaWithImagefield.patch | 5.98 KB | maulwuff |
#27 | formatter2.png | 15.78 KB | maulwuff |
Comments
Comment #1
Mark Theunissen CreditAttribution: Mark Theunissen commentedYeah it would be possible, but I'm not going to be supporting this. Patches welcome.
Comment #2
Mark Theunissen CreditAttribution: Mark Theunissen commentedI'm just working on the code again and I realised that you could do this relatively easily by overriding some variables in a custom preprocess function. Here's the original for you to override:
Comment #3
ica CreditAttribution: ica commentedHi Mark, thanks for your reply but I am not a PHP coder,
so what is the diff to try to patch with this original code? that you pointed on line 86 after the
* Preprocess the galleria variables.
on the galleria.module
Comment #4
Mark Theunissen CreditAttribution: Mark Theunissen commentedTo be honest, this module is still a 'developer's preview'. I am changing the API functions constantly, therefore if you're not a developer I don't recommend that you use it.
When the code becomes mature I will make a proper release and then you can download it!
Comment #5
ica CreditAttribution: ica commentedThank you for your explanation Mark, I will keep eye on for the proper release
Comment #6
q_man CreditAttribution: q_man commentedI too would love to see this work with CCK Imagefield, more specifically with output from Views which contain CCk imagefields (with images stored in a secure directory about the public folder on the server), including summary versions of those views for my current project.
The galleria demo is so beautiful I would love to have my site look like that - current project here: http://www.disscamera.org.uk
As you can see it's ugly and many views I can't even get to show the images or a single example of them for a particular person/ tag or competition when I want them to.
I might be able to raise some bounty/ pay some sponsorship if you can help me with this though it is a small non profit club we could probably scrape up some funds.
Comment #7
Mark Theunissen CreditAttribution: Mark Theunissen commentedOne of the reasons I chose to work with Upload module instead of ImageField module is because ImageField is still in alpha.
When it becomes stable, I'll reconsider it... sorry, I don't really have the time otherwise..
Comment #8
iaminawe CreditAttribution: iaminawe commentedsubscribe
Comment #9
roger6106 CreditAttribution: roger6106 commentedsubscribing as well
Comment #10
kockenque CreditAttribution: kockenque commentedsubscribe
Comment #11
mehmeta CreditAttribution: mehmeta commentedThere you go folks. With the patch, the module treats the CCK imagefields just like any other file attachment. I was confused on how to get the content types to use this module, so added a quick pointer on admin settings as well. The patch is on top of the latest beta2 release. Enjoy!
Comment #12
mehmeta CreditAttribution: mehmeta commentedComment #13
mehmeta CreditAttribution: mehmeta commentedA small fix, please use this file instead.
Comment #14
Mark Theunissen CreditAttribution: Mark Theunissen commentedmehmeta, thanks for the patch! There are a few issues with it though.
1) The form element $form['galleria_content_type'] does not use Drupal's t() or l() functions at all. However, in principle it's a good idea to put a message in there somehow. Maybe drupal_set_message() would be better?
2) Your approach is to add the images to node->files array. While this works and would probably be fine in 90% of the cases, it's a very hackish way to approach CCK. The correct way to implement this would be to write a CCK formatter for image fields (much the same way that lightbox does).
For those reasons I'm not going to commit this patch. You're welcome to resubmit. Check out the http://drupal.org/project/cck_formatters project for examples on how to work with formatters.
Comment #15
kirilius CreditAttribution: kirilius commentedI don't use Linux and can't use patches. How can I get a working Galleria patched so that it takes it's images from an imagefield?
How about a new release with the patched code? A branched release?
Comment #16
kirilius CreditAttribution: kirilius commentedCan anybody post the patched code for the template_preprocess_galleria function?
Comment #17
ChrisBryant CreditAttribution: ChrisBryant commentedsubscribing
Comment #18
kirilius CreditAttribution: kirilius commentedThis module here might be the solution for this issue: http://drupal.org/project/views_galleria
Using views as a source for any presentation module (not just Galleria) is the way to go because of its flexibility.
Comment #19
maulwuff CreditAttribution: maulwuff commentedhere is a patch to use imagefield, if present. you have to set the name of the field in the settings page
this is for 6.x-1.0-beta4
please review
Comment #20
maulwuff CreditAttribution: maulwuff commentedComment #21
Mark Theunissen CreditAttribution: Mark Theunissen commentedThanks for the patch. The problem is that it's still not the correct implementation (see my comments in #14 above).
The correct way to do this is by writing a CCK formatter (see the example projects http://drupal.org/project/cck_formatters).
Comment #22
maulwuff CreditAttribution: maulwuff commentedok, there are still some problems with my patch, like "empty fieldname will break your site" and "no caption for images are shown".
I'll have a look at the formatters. Do you have any experience with them?
Comment #23
Mark Theunissen CreditAttribution: Mark Theunissen commentedYeah I do, but I don't have time to write the patch myself unfortunately.
Comment #24
maulwuff CreditAttribution: maulwuff commentedcan you give me a hint, what to do with the images in the formatter? as it gets called for every image in the imagefield, I can't build up a whole galleria. I think I have to pass them to somewhere else for the final theming
Comment #25
Mark Theunissen CreditAttribution: Mark Theunissen commentedThe formatter function gets called once for the imagefield, passing in every image in that one field (it has to be a multi-field). At that point, you generate the HTML much the same way as the existing theme function does (it may just require refactoring the theme function).
Comment #26
maulwuff CreditAttribution: maulwuff commentedhere we go. imagefield themed by the formatter
please review.
in order to get it to work you have to go to content type -> manage field, set formatter to "Styled by Galleria".
see attached image
Comment #27
maulwuff CreditAttribution: maulwuff commentedbetter image
Comment #28
Mark Theunissen CreditAttribution: Mark Theunissen commentedNice work, I'll review next week, but it looks like you got the correct thing there (from the screenshot)!
Comment #29
Mark Theunissen CreditAttribution: Mark Theunissen commentedCould please re-roll the patch with the -up switch as per http://drupal.org/patch/create? Against the DRUPAL-6--1 branch, which has a number of small bugfixes of late...
Thanks!
Comment #30
Mark Theunissen CreditAttribution: Mark Theunissen commentedAs soon as this is done, I'll commit #371797: opening the main image with lightbox and #353642: jCarousel integration
Comment #31
maulwuff CreditAttribution: maulwuff commentedhere we go. Patched against the 6 branch (hopefully)
I replaced the file extension thing by file_validate_extensions()
Comment #32
Mark Theunissen CreditAttribution: Mark Theunissen commented1) We can't use file_validate_extensions() because it skips validation for user #1. Normally, a beginner who is using the Galleria module will be logged in as user #1 and thus will circumvent this check.
2) Your indentation and code formatting isn't consistant, you're using two spaces, one space, and tab characters. Sometimes even 4 spaces.
3) The comments are not in the correct format. They shouldn't be one space to the left, but start on the same column.
4) You've copy-pasted functions from the examples and left old comments that don't apply to the Galleria module. e.g. "Theme a textfield as a comma-separated list."
Please run your changes through the http://drupal.org/project/coder module on strictest mode, and then re-roll patch against DRUPAL-6--1 (which has had another commit as of writing this comment).
Sorry to be a pain. ;)
Comment #33
Mark Theunissen CreditAttribution: Mark Theunissen commentedComment #34
maulwuff CreditAttribution: maulwuff commented"pain" ... that's the word man. I rehacked the patch in a diff-tool while having "max payne" on my mind. You could have applied my patch before getting active again. There was no commit for 1 month.
Please fix these issues and commit. Sorry for the comments, though. I won't spend another evening on that.
Comment #35
roger6106 CreditAttribution: roger6106 commentedI am looking forward to this patch being moved into the project. It looks like this module will be exactly what I need once this is added. maulwuff, thanks for the work you have been doing on this patch.
Comment #36
Mark Theunissen CreditAttribution: Mark Theunissen commentedOk I'll see if I can squeeze some time tomorrow..
Comment #37
eromba CreditAttribution: eromba commentedHere's a re-roll of the patch from #31 against the latest dev version, and I believe I've covered everything that you pointed out in #32, Mark.
I've tested this with the Upload module and everything seems to be working as intended. However, I have NOT tested the patch whatsoever with CCK Imagefield, so my efforts may quickly prove to be made for naught. I did follow maulwuff's work closely, though, so I'm crossing my fingers!
Comment #38
Mark Theunissen CreditAttribution: Mark Theunissen commentedThanks prof1337. The patch is great, but I fear that the logic is still wrong. All the code that was located in a theme function is now in a non-overrideable function called "_galleria_build". Anyone who has implemented a theme preprocess function will get a nasty surprise.
There is also no way to override the themeing of a galleria in one place for both the CCK field and the uploaded files. I.e. I can override the theme function for the CCK field, or for the upload files, but they have to be separate.
The correct approach is to have one theme function that returns a themed galleria that is called by both the CCK and the file upload sides.
I will see if I can sort this out today.
Comment #39
Mark Theunissen CreditAttribution: Mark Theunissen commentedDeleted - never mind
Comment #40
maulwuff CreditAttribution: maulwuff commentedthe upload module uses objects for the attachments, while imagefield uses arrays for the items.
originally I built up an array to pass it in to _galleria_build().
prof1337 switched it to object.
Comment #41
Mark Theunissen CreditAttribution: Mark Theunissen commentedThere are other considerations too - for example the lightbox link will only work with a Galleria created from attached files. For the moment, I think this is acceptable. I've commited the patch with quite a few changes (fixing the theme issue I mentioned above).
Please inspect the diff.
Thanks everyone! Let me know how your testing goes.
Comment #42
eromba CreditAttribution: eromba commentedLooks good, Mark! Good decision regarding the theme functions.
The new dev version seems completely operational with uploads made via the Upload module.
Comment #43
frost CreditAttribution: frost commentedI've got Galleria working fine with attachments, but would prefer to use Image Fields if possible (mainly because I want to be able to use image_fupload for bulk uploading), so just tried to test the new support for CCK Image field, which is a great addition. However, I cannot get it working. May simply be a documentation/understanding issue? Anyway here's what I've done:
Created new content type with FileField and Image Widget. Content type set to use Galleria.
Created new node of the new content type, with a couple of images attached
Viewing the node just gives me the (expected) error message "Invalid Galleria: there are no attachments.", because the content type doesn't have any attachments. That tells me it is Galleria-enabled, but the images don't show up in a Galleria display so its just an ordinary display of the node.
I assume I've missed something; is there something else I need to do to get Galleria to recognise the Image Fields?
Thanks!
Versions:
Drupal 6.9
Galleria 6.x-1x-dev (29 April 09)
CCK 6.x-2.2
File Field 6.x-3.0
Image Field 6.x-3.0
Comment #44
frost CreditAttribution: frost commentedSorry, my bad. I forgot to set the CCK formatter to display the new field as a Galleria for the new content type!
Comment #45
maulwuff CreditAttribution: maulwuff commenteddid you set the field formatter of the imagefield?
see #26 and #27
edit: you were first ;)
Comment #46
TheAlienShore CreditAttribution: TheAlienShore commentedAwesome! I'm anxiously awaiting the next dev version with this patch included. Thanks!
Comment #47
Mark Theunissen CreditAttribution: Mark Theunissen commentedYou can download and try the dev version! Test it out.
http://ftp.drupal.org/files/projects/galleria-6.x-1.x-dev.tar.gz
Comment #48
perandre CreditAttribution: perandre commentedWorks great! I had to turn the Galleria warning on and off (didn't work right away). If on, you still get a warning when using fields (not core upload). Thanks!
Comment #49
Mark Theunissen CreditAttribution: Mark Theunissen commentedYou don't need to enable the Galleria under "Workflow settings" for a content type, if you are using the CCK implementation. I have updated the text on the form so it explains this.
Comment #50
TheAlienShore CreditAttribution: TheAlienShore commentedI'm using Galleria successfully with ImageField. The only issue I'm still having is I've set a maximum of images to 10. If a user doesn't upload exactly 10, Galleria still tries to display 10 thumbnails and displays error messages in the remaining ones. Please see attached screenshot. Thanks.
Comment #51
Mark Theunissen CreditAttribution: Mark Theunissen commentedThanks for the bug report, I can imagine that it would do something like that ;)
Will try fix next week.
Comment #52
davidwhthomas CreditAttribution: davidwhthomas commentedheh, perhaps I should have checked this issue queue first, I made a simple patch to use imagefield.
You can choose the imagefield to use and choose the mode - upload module or imagefield
more info:
http://drupal.org/node/465518
DT
Comment #53
Mark Theunissen CreditAttribution: Mark Theunissen commentedThanks, but as you can see, the feature is already implemented!
Comment #54
Mark Theunissen CreditAttribution: Mark Theunissen commentedFixed in dev using attached patch.
Comment #55
TheAlienShore CreditAttribution: TheAlienShore commentedAwesome! Thanks, Mark. It works perfectly.