Hi all,
Is there any way for colorbox to display extra photo info such as Alt text or description? At the moment just the title and the photo number show up.

Great module, thanks for all the hard work! Liking the views handler! Joe

Comments

frjo’s picture

The new views handler is the solution you need. With it you can add what you want to the Colorbox.

Very interested in feedback for this feature since it's very new and not mush tested.

joecanti’s picture

great thanks frjo,

Only had a very quick play but will give it a proper road test - also interested in it for opening up a variety of other content so will post back here shortly,

thanks for the reply, Joe

joecanti’s picture

Hi Frjo,

Ok - done some testing with the views handler:

First of all great job! This has a lot of potential for easily opening up any content into the colorbox which is definately a bonus for user interface.

I have attached some screenshots of the results of a bit of messing around.

01 - just the photo plus the title and the alt text below set to the right height

02 - Contact Form (webform 3.x) - but submission takes you out of the form

03 - 50% width and height - takes width and height of screen rather than dynamic content (you mentioned this on the post)

04 - Many thumbs - could only get this by grouping - if no grouping just the first is shown.

05 - Ajax works well here too!

The thing is this could be taken in so many different ways it might be hard to develop - but as the developer thats your call (i'm useless with code - I just stick to the design!)

What I thought was great: the ability to add basic html to the popup box to lay the content out, and ajax on the webform!

If I were any good at code I would somehow add the following features:

- Add a setting so many fields can be displayed on one colorbox eg 'display the first 10 thumbnails' - similar to views display number.

- Add a system to somehow predict dynamic content. eg photos portrait and landscape - in the case of thumbnail 1 maybe a system to say height = 120% of the photo field so as to add some space for the text below? (i realise this may be impossible given the nature of the dynamic content)

- Add integration with Semantic Views or similar so that fields can be styled. I tried this out in pic 01 - title and alt styled as H2 and H3 but didn't appear in colorbox as I guess it gets styled on its own .

I'll carry on testing tomorrow - would like to get the node edit form opening up in it - do you know how to get forms into views successfully?

By the way - what was your main reason for developing this? Did you have an end application in mind? Is it likely to be a lightweight solution for opening forms up in the colorbox? I've read a bit about opening up forms - had a go but no luck - was going to try again but then the views handler arrived so tried that instead....

Thanks for the hard work,

Joe

frjo’s picture

Thanks for testing this out!

As I mention in #799216: Views Colorbox custom field handler the code is taken from the Lightbox2 module. I thought it looked really neat and adapted it for Colorbox.

Adding h2-tags to the title and similar should be no problem. I just tested this and it work. By adding class/id to the tags you can then style them to your liking via CSS in your theme.

<h2>[title]</h2>
[body]

The two other feature requests would be good but I don't know if they are even possible to implement.

For forms there is another built in feature in Colorbox. I noticed that the README have old information about this, I have just committed a update to 6-dev.

If you check "Enable Colorbox load" in the Colorbox settings you can add links like this:

<a class="colorbox-load" href="/colorbox/form/user_register?width=500&height=250">open user_register form in Colorbox</a>

It works with these forms at the moment: contact_mail_page, user_register, user_pass, user_login and user_login_block. If you wish to add forms to this whitelist please make a feature request for it.

joecanti’s picture

Thanks for the heads up on using H2 tags etc - really useful to know for styling the content. I noticed the security issue mentioned in the issue queue) for opening up other forms, so will stick to forms which dont edit content for now... I do usually get 'request unsuccessful' when trying most forms though?

I've been testing quite a few lightbox style plug ins and none that I can find (apart from lightbox) allow this view handler type of function. Its great for adding more info into photo galleries - eg title, alt text and description.

The no resizing does stop this from being really useful - but I think thats more for colorbox in its traditional application on galleries as a photo viewer.

I could see it being really useful for things like product details, or more specs etc where there would be no need to dynamically adjust to the given content, because all the content is pre sized (eg imagecache)

Good work - I'll be keeping up with this module.

Thanks, Joe

frjo’s picture

Status: Active » Fixed

You will get "request unsuccessful" on all forms that have not specifically been whitelisted.

The whitelist: contact_mail_page, user_register, user_pass, user_login and user_login_block.

If you wish to add forms to this whitelist please make a separate feature request for it.

Status: Fixed » Closed (fixed)

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