2👍
If you look at the template used by the text plugin you’ll notice that it simply renders the contents of TinyMCE (or whatever WYSIWYG editor you are using) so the markup you are seeing is likely from there, not the template.
You can override this template yourself by creating a text.html
file in your templates folder (i.e /templates/cms/plugins/text.html
) and adding a surrounding div
:
<div class="cms-text-plugin">{{ body|safe }}</div>
now you can target the elements with CSS:
.cms-text-plugin p{ ... }
.cms-text-plugin h1{ ... }
0👍
You can override the template for each CMS plugin by creating the same directory structure and file name in your templates directory. Then you can control the markup. This concept is the same as overriding any other template provided by a 3rd party in Django. It’s just like overriding a template provided by admin, etc.
- [Answered ]-What is Django model field choices best practices?
- [Answered ]-Elastic Search HTTPConnectionPool(host='127.0.0.1', port=9200): Max retries exceeded