Skip to content
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

Is it possible to add html class for image? #855

Closed
hendryiskandar opened this issue Nov 23, 2018 · 5 comments
Closed

Is it possible to add html class for image? #855

hendryiskandar opened this issue Nov 23, 2018 · 5 comments

Comments

@hendryiskandar
Copy link

hendryiskandar commented Nov 23, 2018

Hallo Oleg,

is it actually possible to add html class for image?
I was imagining like in the following code.
{{ cms:file example, as: image, label: "My Photo", class: "class-1 class-2 class-3" }}

Thanks in advance,
Hendry Iskandar

@GBH
Copy link
Member

GBH commented Nov 23, 2018

No, there's no support for that. Easy solution is to give image a container and style using that:

<div class="class-1 class-2 class-3>
  {{cms:file foo, as: image}}
</div>

@hendryiskandar
Copy link
Author

Thanks for the replay Sir...

I have modified the plugin so that it's possible to add html class directly to img tag since there are some html class in Bootstrap that are meant to be placed directly in the img tag (at least as written in the documentation).

1 question, it is OK to modify the plugin to fit my own needs right? Or is it prohibited?

Thanks in advance,
Hendry Iskandar

@GBH
Copy link
Member

GBH commented Nov 23, 2018

Yeah, feel free to fork and do whatever you need. 👍

@hendryiskandar
Copy link
Author

Thanks Sir and have a great day! God bless You.

@robmathews
Copy link
Contributor

robmathews commented Dec 7, 2018

I'd really like to be able to do this. Adding the div is cumbersome. @hendryiskandar can you point me to the change you made to the plugin to enable this?

robmathews pushed a commit to GoodMeasuresLLC/comfortable-mexican-sofa that referenced this issue Dec 8, 2018
…ans your <img> and <a> tags can have a custom html tag. updated documentation, tests.

Fixes issue comfy#855 "Is it possible to add html class for image? "
robmathews pushed a commit to GoodMeasuresLLC/comfortable-mexican-sofa that referenced this issue Dec 8, 2018
…ans your <img> and <a> tags can have a custom html tag. updated documentation, tests.

Fixes issue comfy#855 "Is it possible to add html class for image? "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants