Great module.

I could read from another post, that for example the label could be removed with this CSS code;
.field-field-FIELDNAME .imagefield-field_FIELDNAME-wrapper label {
display: none;
}

For example I have a extended field called "fapi_surname".

What should the first line of the CSS code look like in order to theme this extended field?

Tried a lot and lots of variants of the code above and variants of normal filefield CSS theming, but nothing works..

Can this be done?

Thanks in advance!

CommentFileSizeAuthor
#2 extended_screendump.png22.87 KBplastikkposen

Comments

alan d.’s picture

The best answer is FireFox & FireBug combo. This will show you the class names instantly!

But to answer your question, use the field name of the image, not the additional property added.

For example, the CCK field "field_images", the CSS is:

.imagefield-field_images-wrapper label {
  display: none;
}
plastikkposen’s picture

StatusFileSize
new22.87 KB

Thanks for reply Alan.

However, I've tried firebug option, but still can't figure it out.

Black hole: .imagefield-field_images-wrapper label (what/how does the code following the "label" part goes?)

Goal: I want to make some of the extended textfields a bit bigger and bolder with CSS code, so the user dont have to bother with formatting text proper.

See firebug code in picture

alan d.’s picture

The label is the HTML element to hide this. There are no default classes to target individual properties, but you can target all via:

.imagefield-field_bestyrelspecics-wrapper {
  ....
}

This effects the label too, unless hidden with the first CSS rule.

If this is not enough, you can override the template imagefield-extended-image.tpl.php in your theme, but you will need to know some PHP programming to do this.

plastikkposen’s picture

Thanks for precise answer Alan

I can confirm the CSS format works:
.imagefield-field_NAME-wrapper { some CSS code }
It will, however affect all fields as mentioned in the post above.

It would have been neat if it would be possible to target individual extended fields with CSS.

I'll try to expore the template approach.

Thank you

alan d.’s picture

Status: Active » Needs review

On about line 343, you could try adding the following line, this should set a class on the specific element

          '#attributes' => array('class' => 'ife-' . str_replace('_', '-', $key)),

ie:

  foreach ($extended_fields['textfields'] as $key => $title) {
    if (!empty($widget['custom_'. $key])) {
      $text = imagefield_extended_check_text($item['data'][$key]);
      if (!empty($text)) {
        $data[$key] = array(
          '#title' => t('!ife:' . $key, array('!ife:' . $key => check_plain($title))),
          '#type' => 'item',
          '#value' => $text,
          '#attributes' => array('class' => 'ife-' . str_replace('_', '-', $key)),
        );
      }
    }
  }

If this works (not testing environment atm) I'll commit it to dev

alan d.’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)