django-cms / djangocms-style

django CMS Style is a plugin for django CMS that allows you to create a HTML container containing classes, styles, ids and other attributes.
https://marketplace.django-cms.org/en/addons/browse/djangocms-style/
Other
38 stars 22 forks source link

"style" is excluded by configuration and cannot be used as a key. #39

Closed binydev closed 5 years ago

binydev commented 7 years ago

I want to add background image to my div created by style plugin, when I try to add style as atribute, it show error

"style" is excluded by configuration and cannot be used as a key.

style="background-image:url(/images/blocks/item1.jpg)"

FinalAngel commented 7 years ago

@bcopmt143 that is correct because style might add padding or margin values to the "style" attribute so it is protected. I'd recommend using https://github.com/aldryn/aldryn-background-image for your use case or other background plugins available.

I'm also happy for a pull request from your end eventually allowing style, but in order to do so there need to be sanity checks and eventually merges if padding/margin are provided and a custom style attribute.

binydev commented 7 years ago

So why don't you add background-image like padding and margin so that it will end the long time problem of background image at djangocms?

FinalAngel commented 7 years ago

@bcopmt143 that would make sense though we would leverage filer instead of a simple text input field. I'll keep that in mind.