Add data attributes to elements for SVG export
I'm using data attributes quite a bit these days, and have been experimenting with using them in SVG. They work very well, as a way of adding metadata or parameters to elements that can later be read by javascript/ES.
But (of course) no support in illustrator for this feature. Worse, if I add them with another tool, then open the SVG in Illustrator, they get stripped from the document entirely. This is just stupid.
Best of all, a data-attributes panel, very similar to the variable panel, but without the redraw bugs. Workflow something like this:
Select an art object.
Go to/Open data-attributes panel.
Click + or select Add attribute from popup corner menu.
Add (e.g.) "mood" with value "happy"
Export SVG
Corresponding element has data-mood="happy" in the markup, which can ne retrieved via javaScript.
This would not just make me happy, but would also be very useful.
-
Brennan Young commented
I think this is a duplicate of https://illustrator.uservoice.com/forums/333657-illustrator-desktop-feature-requests/suggestions/37298245-add-data-attributes-to-elements-for-svg-export which is older and has more votes
-
Anonymous commented
I need this feature, too
-
Mike B commented
+1. This would save so much time!
-
Michael Vermeulen commented
Can't wait that this is finally there!
-
Ryan commented
+1. This would be a wonderful feature.
-
Alberto Morvillo commented
Please add an easy to use SVG tag and attributes editor for the each element, including the document..
For example, the <desk> and <title> tag and the data-* custom attribute would be all appreciated.The interface could a be a panel with a simple table (with all the tag names on the left and the values on the right) and a plain text field for custom attributes.
-
Joe M. commented
This would be hugely useful. I'm surprised there isn't a feature in Illustrator yet. Would make maintaining data attributed to elements so much easier to maintain.