verbb / icon-picker

A Craft CMS field to select SVG or font icons from a folder for use in your content.
Other
17 stars 8 forks source link

Ability to search tags in icon sets #46

Closed siebird closed 1 year ago

siebird commented 2 years ago

Some icon sets have tags associated with the icon for related search terms. This would be a nice alternative for vs. searching by filename.

For example, Health Icons has a meta-data.json that has tags related data (example below). Feather Icons does something a little different: https://github.com/feathericons/feather#api-reference

[
 {
  "id": "war",
  "category": "vehicles",
  "path": "vehicles/war",
  "tags": [
   "Armored Vehicle",
   "Cannon",
   "Gun",
   "Military",
   "Tank",
   "dhis2:war"
  ],
  "title": "War"
 },
 ...
]
engram-design commented 2 years ago

Yep, this is on my long-term roadmap to address, somehow. The issue really is that so many icon sets define this differently, like Font Awesome do a similar thing. It's about how to store this information I need to work out.

In addition, only the filename for an icon is currently searched, for performance. We'll be improving that in the next major version to include metadata, through our own non-jQuery dropdown solution.

siebird commented 2 years ago

Good to hear! I'll be curious to see how you solve it.

engram-design commented 1 year ago

Added the ability to set metadata in 2.0.0 see docs