-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to create a CSS class for image field in Views #2920
Comments
@simone960 I agree, the option to provide an image class in Views is helpful. That said, I'm not sure where the best place in the UI would be: Directly beneath the Image Formatter (and so on) settings, or in the "Style settings" section. I guess we need however more feedback here! |
Personally I would prefer to have it placed somewhere below the Image Formatter instead of "Style settings". It is relevant, direct and obvious location for a new and distinctive feature. If we put it under "Style settings", those who come from Drupal may overlook it because of the familiarity with the Views. Honestly, I don't often use those features in the styles settings. If I were to add wrapper to fields, I would rather to use a Global: Custom text field and throw everything inside as it is easier to see things in one place for the ease of maintenance. Just some thoughts. Others ? |
We should note that there is an existing "Customize field HTML" option with an accompanying "Create a CSS class" option (this is available for all fields; not just image fields). So, one can add custom classes to the image field wrapper, but not the image field As a site builder, I would like to not have this be an imagefield-specific thing. I have looked into a couple of ways to achieve this, and I have identified a couple of things that we are missing at a lower level. I would love it if we could address these in core:
|
...question is. Would we still need to add a dedicated field for adding CSS directly to the |
Create a css class for Image field in Views
In Views, when adding an image field there's no way I can add a css class to the image tag. For example, if I were to shape the image to a circle using bootstrap I have to add a
.rounded-circle
class to the image and I couldn't find a way to do it. So I think it's conveninent and important to have such function added to the views.<img src="cinqueterre.jpg" class="rounded-circle" alt="Cinque Terre">
Here just a sample I imagine how it would look like or something similar. Please consider. Thanks!
The text was updated successfully, but these errors were encountered: