Field type image : need to add a default class to " img " element if Image style is set to " None (original image) "

Created on 22 February 2017, almost 8 years ago
Updated 12 March 2023, almost 2 years ago

Problem/Motivation

Default field template for image fields contains image name class, but no class when no class (original image) is displayed.

When using image style thumbnail:

<img property="schema:image" src="" width="100" height="42" alt="" typeof="foaf:Image" class="image-style-thumbnail">

When using None (original image):

<img property="schema:image" src="" width="100" height="42" alt="" typeof="foaf:Image" class="">

Proposed resolution

Add `image-style-none` class when image is displayed as original (no image style). This should be done in default field template file:

<img property="schema:image" src="" width="100" height="42" alt="" typeof="foaf:Image" class="image-style-none">

Remaining tasks

Submit the patch.

User interface changes

No UI change

API changes

New `image-style-none` CSS class exposed by default field templates.

Data model changes

No data changes.

๐Ÿ› Bug report
Status

Needs work

Version

10.1 โœจ

Component
Image systemย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia vishwac9

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024