Hello, thanks for this excellent module.

I'm trying to use the background image field in a panels pane. However, the makeup inline css settings are not sticking -- they re-set back to defaults every time I save.

thank you...

Comments

sashainparis’s picture

Hi Elena!

There have been an issue on CTools side about saving ImageField settings in Panels.

Can you verify this: #2397709: Set #tree property in the proper place ?

Make sure your includes/fields.inc in CTools code look like this:

    if ($settings_form) {
      // Allow other modules to alter the formatter settings form.
      $context = array(
        'module' => $formatter['module'],
        'formatter' => $formatter,
        'field' => $field,
        'instance' => $instance,
        'view_mode' => $view_mode,
        'form' => $form,
        'form_state' => $form_state,
      );
      drupal_alter('field_formatter_settings_form', $settings_form, $context);

      $settings_form['#tree'] = TRUE;
      $form['ctools_field_list']['#value'][] = $field;
      $form += $settings_form;
    }

If your CTools version is OK, I guess we will have to search a little more... ;-)

Regards,

Alexandre

sashainparis’s picture

Status: Active » Postponed (maintainer needs more info)
tchopshop’s picture

Thank you for such a prompt response!

My Ctools includes/fields.inc does look exactly like that... starting at line 81. So that isn't perhaps the issue, unfortunately.

sashainparis’s picture

You're welcome.
Just to be sure: can you confirm me it works fine with entities fields (node, bean, etc.) ?

If yes, I would need more element about your settings.

Regards,
Alexandre

tchopshop’s picture

It does save my settings in the node's manage display form, if that's what you mean. But I'm using panels because here's my situation:

I am trying to create a landing page with background images interspersed between sections of content. My background image field is set to "unlimited" and I'm inserting each image into its own panel via the delta settings. Each has its own field settings for inline css (i.e. each image is applied as background to a different css selector).

I have not checked if this works with multiple-value fields... but it doesn't seem like that would be the issue.

tchopshop’s picture

Ok, I just tested with a single-value field and it's also not saving the inline css settings.

sashainparis’s picture

Elena,

I don't have time to test a panels installation now.

A turnaround could be to use a Bean block with the delta token to match your pane (such as ".mypane_[delta]" - verify the exact token name...): you will have to provide a class "mypane_2" to the pane you expect to use the second image.

Instead of a Bean, any entity bundle will do the job - including panel page I guess.

If you need to define different settings for several groups of panes, you then will need several fields as settings are at bundle level, not at pane level.

Not sure if this is clear enough.
Regards,

Alexandre

tchopshop’s picture

Hi, thank you... i'm using Panels Everywhere, so I'm not using beans or blocks. The images are on the node, which I'm displaying in a panels node.

It seems like I'd have to have multiple fields then multiple view modes -- each view mode to only display that one field. Then on the panel display the node in that view mode.

I really dislike that idea because I'd have to have a proliferation of view modes.

Would a view work? I mean to create different settings for a multiple image field?

sashainparis’s picture

Hi,

Personally, I like View modes - whatever... :-)

Yes, It should be alright with views - I guess you talk using Field displays.

Just tell me if you found your way out.

Regards,

Alexandre

sashainparis’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Hi,

I close it as I received no feedback.

Feel free to reopen it if necessary.

Regards,
Alexandre