Siva Arunachalam
Siva Arunachalam

Reputation: 7760

Django django-admin-tools DashboardModule - HTML Content

The django-admin-tools says, we can use HTML (or) Text in the children. But It's escaping the given HTML Tags. All the tags have been displayed as given without rendering.

self.children.append(modules.DashboardModule(
                  title = 'Example',
                  children = ['<b>bold example</b>',],
))

Upvotes: 1

Views: 1054

Answers (2)

Siva Arunachalam
Siva Arunachalam

Reputation: 7760

edit the template

admin_tools/dashboard/module.html

and add

{% autoescape off %} {% endautoescape %}

Upvotes: 1

Josh Smeaton
Josh Smeaton

Reputation: 48730

From the documentation:

pre_content
Text or HTML content to display above the module content. Default value: None.

content
The module text or HTML content. Default value: None.

post_content
Text or HTML content to display under the module content. Default value: None.

No where in that whole document does it say that the children property can contain HTML.

Upvotes: 0

Related Questions