You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to utilize the djangocms-icon module to incorporate my own SVG icons into my Django CMS project. Following the documentation, I have successfully added Material Design icons. However, I encounter issues when adding my custom SVG icons.
The issue arises in the generated markup. In the icon addition widget inspection, there is a missing /static/ before sprites/icons.svg#svg-icon-card. Additionally, in the page render, there is an extra svg-icon class after the # in the xlink. The generated markup looks like this:
I've found a workaround. I replaced "spritePath": "sprites/icons.svg" with "spritePath": "/static/sprites/icons.svg" in the json file.
I created a custom filter:
@register.filter(name='patch_icon')
def patch_icon(value, arg):
spaced_prefix = '{} '.format(arg)
text = value.replace(spaced_prefix, '')
return text
I am attempting to utilize the djangocms-icon module to incorporate my own SVG icons into my Django CMS project. Following the documentation, I have successfully added Material Design icons. However, I encounter issues when adding my custom SVG icons.
In my settings.py, I added the following code:
I have created an iconset.json file at the root of my project:
I have also created my icons.svg file in static/sprites/icons.svg:
Additionally, I created templates/djangocms_icon/svg/icon.html:
The issue arises in the generated markup. In the icon addition widget inspection, there is a missing /static/ before sprites/icons.svg#svg-icon-card. Additionally, in the page render, there is an extra svg-icon class after the # in the xlink. The generated markup looks like this:
There is a missing /static/ before sprites/icons.svg#svg-icon-card.
There also an issue in my rendered page with an extra "svg-icon " after the # in the xlink.
How can I resolve these issues?
The text was updated successfully, but these errors were encountered: