简体   繁体   中英

How to add classes to django-cms text plugin

I am putting the text plugin in a

tag which has its classes and style. but when adding the text in text plugin it creates a

tag for it self. So, it is not getting the styles I want it to get is there a way to remove

tag placed by the text plugin or add classes to it?

HTML:

{% load cms_tags menu_tags sekizai_tags %}
{% load static %}
<!DOCTYPE html>
<html lang="en">
<body>
<p class="post-meta">
Posted on {% block post_date1 %}{% placeholder "post_date1" %}{% endblock post_date1 %}
</p>
</body>

result

<!DOCTYPE html>
<html lang="en">
<body>
<p class="post-meta">
Posted on <p> November, 20, 2020</p>
</p>
</body>

The way the text editor works, it'll create that default paragraph from your content.

The easiest thing for you to do is change your template to;

{% load cms_tags menu_tags sekizai_tags %}
{% load static %}
<!DOCTYPE html>
<html lang="en">
<body>
{% block post %}{% placeholder "post" %}{% endblock post %}
</body>

Then when you add the content to the plugin, add the post-meta class to the paragraph tag using the source view of the text editor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM