GithubHelp home page GithubHelp logo

Comments (5)

vxsx avatar vxsx commented on June 10, 2024

3fb2c1a should've fixed this problem

any chance you are using it on Divio Cloud? if that's the case and the addon was upgraded - please make sure that the static files and template are removed from the project.

i will try to reproduce in the meantime

from djangocms-icon.

SteinRobert avatar SteinRobert commented on June 10, 2024

I'm using version 1.0.0. Let me know if you cannot reproduce the issue.
I'll have a look at removing the templates and statics. It is indeed a customized docker image we're using.

Edit: I deleted the statics and templates - this did not change the behavior. Selecting an icon from the 2nd iconset leaves the user with a preselection of the first icon of the first iconset when opening the admin/plugin again...

Edit2: @vxsx I noticed this behavior only with 2 SVG sprites so the first step of the reproduction is wrong.
The setting should look like this:

DJANGOCMS_ICON_SETS = [
    (ICONSET, 'icon', 'SVG icons'),
    (ICONSET2, 'icon2', 'SVG icons 2'),
]

from djangocms-icon.

vxsx avatar vxsx commented on June 10, 2024

I can reproduce the problem with 2 svg iconsets, thanks, looking into this

from djangocms-icon.

vxsx avatar vxsx commented on June 10, 2024

It looks like the field renderer tries to infer the iconset out of the icon name:

https://github.com/divio/djangocms-icon/blob/dd8abebd32ffb94e001dd3028e8f01b5fd84cb8d/djangocms_icon/fields.py#L31-L37

Meaning that if value is icon-something it would think that the prefix is icon. So it would select the iconset based on that. And in case the iconset prefix doesn't match the one in settings it would always pick the first one no matter what. This is likely what leads to the bug you're experiencing

from djangocms-icon.

SteinRobert avatar SteinRobert commented on June 10, 2024

I can confirm this. Changing the prefix in my second symbol-def SVG file make the whole thing work.

from djangocms-icon.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.