Automaticlly assign class to all images in RTE for...
# help-with-umbraco
m
Is there a way to configure TinyMCE to add a css class to all images inserted into the RTE automaticly? It looks like https://www.tiny.cloud/docs/plugins/opensource/image/#image_class_list says you can but I don't see how to apply that config into Umbraco or if that is eve the plugin used for by Umbraco.
h
The Umbraco RTE has it's own custom Image implementation, so I would imagine this is not possible.
o
I would try adding css rule on front-end.
m
How do you mean? If Umbraco generates the HTML when I do an
@Model.rteBlock
I can't easly just add the classes from the front end. What I am hoping to do is have Umbraco auto-add a class the the images.
h
you could render your rte into a div with the class to apply to the images
Copy code
<div class="myclass">@Model.rteBlock</div>
and use that as the selector to apply your css .myclass img {...}
m
Yea, that was the conclusion I came to last night. Was hoping to avoid a container class but it is what it is and when your as limited in skill as I am I guess I will have to take it
7 Views