Somethings I changed might be useful.

1. Inside the Colorbox admin section under the Custom settings area I've added "slideshowAuto" with helper text of "Sets if slideshow will automatically start to play." Radio buttons for same as above, (No, and Yes) defaulted to Yes b/c thats what Colorbox defaults to.

2. I'm using the Insert module & the image resize filter module along with a wysiwyg editor. This allows some images that are resized to open the full size one inside a Colorbox. If the title text was not filled out it checks the alt text. This already happens inside the module if you print things out with CCK. This minor tweak just adds a function to the title section inside Drupal.behaviors.initColorbox

Links to above modules:
http://drupal.org/project/insert
http://drupal.org/project/image_resize_filter

Still new to making patches so please test :)

CommentFileSizeAuthor
colorbox_tweaks.patch3.12 KBgooddesignusa
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frjo’s picture

Version: 6.x-1.0-beta1 » 6.x-1.x-dev
Assigned: Unassigned » frjo

Adding more of the Colorbox script settings is no problem. Any other candidates besides "slideshowauto" to add?

The title manipulation I'm unsure about. Is not easier and more reliable tot simply add a title attribute to the image to begin with? Are there some solutions that does not give you this option?

I always use CCK image fields myself and I plan to add support for the Insert module, http://drupal.org/project/insert.

gooddesignusa’s picture

Depending on which wysiwyg editor your using sometimes it only lets you set the ALT text.("from the editor") This will result in the colorbox having no title / caption. I know if the user fills out the title / alt text in the CCK field before they hit insert its fine. But what if you aren't going to use CCK & insert to upload images but some other way. Maybe through the editor? Either way the little bit of javascript would just help make sure the title isn't blank when it could say something. I'm sure we could rewrite it to be a little leaner. its super simple. When people use CCK to output it the module code takes care of this so the javascript code wouldn't matter since it would be filled out.

As to getting it to work with insert it already does. You just add a class of colorbox in the settings of the input filter.

frjo’s picture

I have now committed new code that adds all the slideshow settings, you now find them in a sub filedset under "Style and Custom settings".

The support for the Insert module has been committed also so please try out the 6-dev version on your test site.

Built in support for the Insert module makes it possible to build a better tag to insert. If the title is empty the alt is automatically used e.g.

Remember to active the Colorbox inline options to the image field under "Mange fields" for your content types.

When you install the latest 6-dev version you will need to reset the "Display fields" for node types and views, sorry about that. It's a one time thing.

gooddesignusa’s picture

Cool I'll try it out today. I'll let you know later...

I just grabbed it and I'm not seeing the new additions.(Slideshow options inside admin area) I'm guessing even though I just grabbed the dev it does not have what you just added. I'm guessing I have to wait a couple hours for it to update?

Update: Sorry I did just check and I don't have the current version. "colorbox.admin.inc,v 1.4" Guess I do have to wait. Curious how long.

Also as a side note did you change the way the title text gets truncated? Maybe add an option inside the admin area to do it instead of it being based on the default theme.

frjo’s picture

Yes, the tar-balls for dev get repacked every 12 hours or so.

To always get the latest you need to get the code directly via CVS.

gooddesignusa’s picture

I never used CVS before so I can't d/l it right away. Anyway you could zip it and email it to me so I can mess around with it today @ work instead of waiting until tmrw.

Would be much appreciated :)

Thanks.

gooddesignusa’s picture

Thanks for the email. I just installed it and noticed the new options :) nice work
One issue i found was when you select No for Slideshow autostart
After saving it still stays on Yes. No matter what I do I can't seem to make it stay on No.

frjo’s picture

Status: Needs review » Active

I can not replicate your problem with setting "Slideshow autostart" to "No" and the code looks ok. Hmm, maybe you need to clear the Drupal cache?

Are you using the Insert module? If so I would be interested to here how you find the new support for it. Please add the feedback about it here http://drupal.org/node/768624.

gooddesignusa’s picture

Today when i got to work i uninstalled colorbox. (installed the one in the email last night)
Reinstalled the dev. The slide show thing is working fine.

I'll mess around with the new insert features today and let you know :)

frjo’s picture

Title: Colorbox tweaks patch » Colorbox tweaks, add and improve settings and more
Status: Active » Fixed

After discussions with gooddesignusa on IRC the following changes and additions have been committed to 6-dev.

* Add settings for Colorbox options overlayclose, maxwidth and maxheight.
* Add gallery option to Insert module integration.
* Numerous minor improvements in the settings form.
* Added function to focus the first field that opens in a Colorbox.

Status: Fixed » Closed (fixed)

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