Sorry for combining two feature requests in one issue. The attached patch:

  • opens a bigger version of the Flickr photos in colorbox
  • provides a text link under the image to the Flickr photo page to comply with their TOS
  • floats single Flickr images in the text body alternately right and left (can be disabled by removing the last section of flickr.css).

It works fine when you use Colorbox.

To make it work with other Lightbox-type modules (to be taken in consideration to be commited) some work should be done.
TO DO:

  • Do not hardcode Colorbox specific elements. On the settings page admin/config/media/flickr we could provide:
    • a text field "class:" (in our case we would fill in "Colorbox" here but it could be any class that triggers a link to be opened in any other Lightbox-type module)
    • a text field "rel:" (in our case we could fill in "gallery-node" to show all images as a gallery)
  • Do not alter the behaviour of existing sites upgrading the Flickr module.
    If before mentioned fields are left empty on the settings page, the image should still link to the Flickr photo page directly and no text link should be put under the image.
  • offer the auto float of single Flickr images in the text body as an optional.
    A checkbox on the settings page that includes the piece of CSS responsible for the floating only if selected.

USE THE LATEST PATCH FROM THE COMMENTS BELOW! NOT THE ONE HERE.

Comments

lolandese’s picture

Issue summary: View changes

Updated issue summary.

lolandese’s picture

Title: Flickr: Colorbox/Lightbox integration. » Colorbox integration & auto float images in text body alternately right and left.
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new7.47 KB

The attached patch:

  • Fullfills the complete TO DO list mentioned in the issue summary. That means the patch can now be used for any Lightbox-type overlay browser that gets triggered by a specific value in the link attribute "class" or "rel".
  • Corrects a bug in the initial patch (using <span> tags instead of <div> so images can be inserted also halfway a paragraph without making it split).
  • Instead of linking to the Flickr Photo Page with the text link saying "Flickr", the photo title is used, except on the small 75x75 square where there is just space for the word "Flickr".
  • CSS improvements:
    • Images in a block are now displayed horizontally.
    • If the title is longer than the image width, it will use more lines.

Colorbox functionality is not included yet in fields (photos and sets as attachments to a content type) and tags (a functionality only active on the user pages).

A working DEMO.

To apply patch use:
patch -p1 < flickr-colorbox_integration-1637464-1.patch
It can be applied against the dev version.

To see any changes, after applying the patch set the Colorbox "class" to "colorbox" and "rel" to "gallery-all" on the settings page (admin/config/media/flickr) and re-save your nodes with Flickr images in them.

Another patch to have more image sizes available at http://drupal.org/node/1440918.

Please ignore the first patch in the original issue summary. Use this one instead.

Anonymous’s picture

Status: Needs work » Needs review

Hi Lolandese,

Apologies for the late reply.

I'm currently working on a project that will probably need these features. I'll get back to you soon.

Best,
Paul Booker

lolandese’s picture

Hi Paul,
Thinking it over, I would exclude the "auto float" functionality from the patch. Let's leave optional extra's up to other modules.
I can roll a new patch if necessary. Just let me know here.

Anonymous’s picture

It works great \ O /

If you would roll another patch as you described I'll get this committed to the development branch.

Best,
Paul Booker

lolandese’s picture

Awesome. The attached patch:

  • has the auto float functionality removed
  • removes the old 778628-migration-to-drupal-7-34.patch
  • 1 out of 1 hunk FAILED -- saving rejects to file README.txt.rej (no idea why, do it separate)
  • does NOT add the new Flickr sizes q and n. Apply the patch at http://drupal.org/node/1440918 for that. I tested if that one applies without errors after the one here.

Did some basic testing in a development site. Only had a problem in the filter with size=n (is using original size instead). Please check.

lolandese’s picture

Title: Flickr: Colorbox/Lightbox integration. » Flickr: Colorbox integration.
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new34.44 KB

Patch similar to #5 attached but this one applies cleanly (no errors). The mistake in #5 was that I didn't use the git version and that made it fail on the .info file.

Use:
patch -p1 < flickr-colorbox_integration-1637464-6.patch

..and don't forget to remove the patch file before pushing the code back to the repository.
;-p~

NOTE: The Auto Float functionality has been improved but moved to http://drupal.org/project/autofloat as a separate module.

lolandese’s picture

Title: Colorbox integration & auto float images in text body alternately right and left. » Flickr: Colorbox/Lightbox integration.
Status: Needs review » Reviewed & tested by the community

Have this running smoothly on several sites with different themes. No objections for several months. Marking RTBC.

erutan’s picture

Title: Flickr: Colorbox integration. » Flickr: Colorbox/Lightbox integration.
Status: Needs review » Reviewed & tested by the community

Any ETA on getting a new 7.x dev? There are a lot of patches in the issue queue but the repo doesn't seem to have been touched for a while.

lolandese’s picture

Anonymous’s picture

Thanks again for the work done here.

Is it possible to break this latest patch up into work that relates directly to the current issue and to create a separate a patch for the work you have done *fixing* the flickrfield module and later add an additional patch here for further Colorbox/Lightbox integration?

Best, Paul

lolandese’s picture

The latest patch (December 20, 2012) already only relates to the current issue.

lolandese’s picture

Title: Colorbox integration & auto float images in text body alternately right and left. » Flickr: Colorbox/Lightbox integration.
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Added note to avoid people using not the latest patch.