creativeorange / craft-article

Edit richt text content in Craft CMS using Article by Imperavi.
Other
7 stars 3 forks source link

Style Background Image Url #19

Closed blvckbeard1337 closed 2 years ago

blvckbeard1337 commented 2 years ago

Hello,

I created a block for plugin, But unfortunately background url its not working, in the first time its shows good, image

but then html purifier add &qout; at the attribute (normal behavior) and after editing article convert background url to unknown path image

So the problem is we can't edit its work only on create. Can I disable html purifier and how, or can you give me another solution.

Thanks

dejury commented 2 years ago

Hi @blvckbeard1337

Thanks for using the plugin and reporting this issue. It is possible to disable the HTML purifier, see screenshot attached. You can do this at the field setup.

Can you please verify if turning this off solves the problem? Afterwards I would like to receive the exact block that you are trying to generate, because in my opinion it is better to fix this problem to work with the HTML purifier.

Schermafbeelding 2022-08-03 om 15 16 29

Thanks!

blvckbeard1337 commented 2 years ago

Hi @dejury,

I fix it by disabling html purifier , the block was designed to create a tag with a background image url. If you create and save it works but if you want to edit html purifer saved code and the plugin reader from previous saved crash on &qout; thing.

You can mark as closed as by now I found a solution. The main problem is not closed if somebody want background image url and html purifier it will not work.

Thanks,

dejury commented 2 years ago

Okay, can you somehow post me this block anyway? I want to solve this with the HTML purifier, because disabling HTML purifier is not always the best solution.

blvckbeard1337 commented 2 years ago

Well I improvise the problem here. I copy tag plugin and modify to produce the problem you can test it.

https://jsfiddle.net/qsvnwdrf/1/

dejury commented 2 years ago

Thanks for the example. I think you can make this work with the HTMLpurifier by using the config for HTML.Allowed or HTML.ForbiddenElements as seen here http://htmlpurifier.org/live/configdoc/plain.html#HTML.Allowed

By setting this up it should make the background-image work. I don't think we should ship this by default.