#36353: Add `content` to `Script` media asset
-------------------------------------+-------------------------------------
Reporter: Johannes Maron | Type:
| Cleanup/optimization
Status: new | Component: Forms
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
This is a follow-up to #35886
I noticed that the `Script` does support any attribute, but not a content
or innerHTML.
Currently:
{{{
element_template = '<script src="{path}"{attributes}></script>'
}}}
Better:
{{{
element_template = '<script src="{path}"{attributes}>{content}</script>'
}}}
You might want to just drop a `import "#myPackage"` inside the script tag,
to lead a file from your importmap.
This would look something like:
{{{
Script(type="module", content="import 'myPackage'")
}}}
I am not sure, if this is a bug, feature request or cleanup, someone
should review the ticket type.
--
Ticket URL: <
https://code.djangoproject.com/ticket/36353>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.