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.
Hi,
After read colorbox documentation I found the width and weight is optional by default.
So on colorbox_handler_field_colorbox.inc i comment this 2 lines:
// 'width' => $width,
// 'height' => $height,
almost at the end of the file.
Now the trigger autoresize.
As I dont know if this have impact in other aspects of the module, for me (who just use on views) I dont get any errors and all work well, so I just leave here to help some people who have same issue.
Comments
Comment #1
pwesthagen CreditAttribution: pwesthagen commentedIt's possible and better to simply set width and height to null in the configure field dialog for the trigger.
Comment #2
Hydra CreditAttribution: Hydra commentedwhat pwesthagen is saying is right! Thank you very much, helped me at the right moment to find your post. I would propose to patch the description, that everyone has this information.
What was exactly the matter for the maintainers to "hide" this feature, would probably be usefull to tell the people this in the description as well, that if they set the value to null *the reason* could happen.
Comment #3
greenwork CreditAttribution: greenwork commentedI have a similar situation that I need an auto size of a percent (say 95% of the screen res). Perhaps I missed a note somewhere about adding this in the INLINE string. I have tried a few variations but no success yet. Sorry if I hijacked this question but it seems similar.
Comment #4
frjo CreditAttribution: frjo commentedClosing old issues that doesn't seem to affect a lot of users.
Comment #5
greenwork CreditAttribution: greenwork commentedDimensions
width false Set a fixed total width. This includes borders and buttons. Example: "100%", "500px", or 500
height false Set a fixed total height. This includes borders and buttons. Example: "100%", "500px", or 500
Comment #6
greenwork CreditAttribution: greenwork commentedI forget if i had to do it in asci not sure though anyways % ->
%
hope that helps anyone
Comment #7
greenwork CreditAttribution: greenwork commentedComment #8
nordicmaterial CreditAttribution: nordicmaterial commentedCurrent version 7.x-2.7 has width and height hardcoded on line 26 and 27 in modules/colorbox/views/colorbox_handler_field_colorbox.inc. How can we enable auto-resizing for current version?
- Removing line 26 and 27: doesn't work
- Adapting line 26-27:
array('default' => '400px');
toarray('default' => '');
array('default' => '600px');
toarray('default' => '');
doesn't work either
- Commenting the lines
// 'width' => $width,
// 'height' => $height,
doesn't work either.
- Setting width and height to "null" or "auto" in the configure field dialog for the trigger doesn't work either.
There is no resizing: colorbox just fills up 100% of the screen.
Using colorbox anywhere else in the website has auto-resize working perfectly though.
Any idea how to solve this?
Comment #9
nordicmaterial CreditAttribution: nordicmaterial commentedComment #10
kopeboy CreditAttribution: kopeboy as a volunteer commentedInterested as well.
Using Colorbox trigger in view makes the autoresize feature not working :(
Why is it any different?!
Shouldn't we able to resize the image after it's loaded with some js?
Comment #11
Neslee Canil Pinto