I think it would be nice to have formatter for image field types in this module. It can live as a part of main module or as a submodule.

There is a sandbox project that implements image formatter for jCarousel and , that adds support for media's "Multimedia asset" fields. It would be nice to merge this into jCarousel.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

slashrsm’s picture

Primsi’s picture

Was going to propose the same thing. So +1 to this.

quicksketch’s picture

I agree this would be a great thing to include as part of the module for "easy-as-pie" carousels of images within a single node. I'm not so certain about including Colorbox and Lightbox integrations (which is built-into the referenced sandbox project)... but the module overall looks like a great starting point.

pitxels’s picture

+1 :)

andypost’s picture

+1 yes, really useful sandbox, also it lacks some options #1295232: Options

rogical’s picture

Very much need, like as views slideshow provides both for views and field formater.

andypost’s picture

There's a project http://drupal.org/project/field_slideshow could be used as alternative

Hydra’s picture

Just recognized, that I did a patch on this a while ago. It's a simple fieldformatter, wich should offer all settings available. Additional it integrates colorbox as image link setting.

Hydra’s picture

Status: Active » Needs review

Status update, sry

jonhattan’s picture

Nice work Hydra! The patch provide all options one could want.

I've found a warning while using it:

Deprecated function: Call-time pass-by-reference has been deprecated in drupal_load() (line 1128 of includes/bootstrap.inc).

jonhattan’s picture

Status: Needs review » Needs work

The reported warning is gone fixing this two things:

+++ b/jcarousel.moduleundefined
@@ -352,3 +351,300 @@ function theme_jcarousel($variables) {
+  $element = image_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state);

& here is wrong.

+++ b/jcarousel.moduleundefined
@@ -352,3 +351,300 @@ function theme_jcarousel($variables) {
+    foreach (colorbox_field_formatter_settings_form($field, $instance_clone, $view_mode, $form, &$form_state) as $setting => $value) {

& again.

Hydra’s picture

Status: Needs work » Needs review
FileSize
11.93 KB

Yeah, right... I had no warnings, so I didn't realized the little paste issue, thanks!
Patch should fix it

broon’s picture

Thanks a lot, Hydra!
Patch applied to 7.x-2.6 works like a charm.

The only thing I am missing is the option to link the image not only to "Content" or "File" but also to use e.g. "Lighbox2".

Peeking into the patch, I see you already supported colorbox, so I added a way to include lightbox2 as well. However, I didn't create a settings section for lightbox2 since I am not really experienced with that module.

andypost’s picture

+++ b/jcarousel.moduleundefined
@@ -352,3 +352,316 @@
+  $options = jcarousel_field_formatter_validate_settings($settings);
...
+/**
+ * jcarousel_field_formatter_validate_settings($settings).
+ * Helper function to validate the options (needed for the javascript to work
+ * properly).
+ * @param type $settings
+ * @return $options (array)
+ */
+function jcarousel_field_formatter_validate_settings($settings) {
+  $mysettings = $settings['jcarousel_settings']['advanced'];
+  $mysettings = array_merge($mysettings, $settings['jcarousel_settings']);

Not sure that it's related to JS.
Also doc-block needs formatting according http://drupal.org/coding-standards details http://drupal.org/node/1354#functions

+++ b/jcarousel.moduleundefined
@@ -352,3 +352,316 @@
+  // Little overview of all changed settings.
+  $summary .= '<ul>';
+  foreach ($options as $option => $value) {
+    $summary .= '<li>' . $option . ': ' . $value . '</li>';
+  }
+  $summary .= '</ul>';

Please do not use markup in summary