Problem/Motivation
Link fields store HTML attributes in their options property. These attributes already reach a links prop and the link field formatter, but no source can send them to an attributes prop. This is needed for components with separate url and attributes props.
The field property source does not cover it: options is a map, which matches no prop type.
Proposed resolution
We could add a "Link attributes" source, one per link field, for the attributes prop type. It returns options['attributes'] of the field item. This is the core link field contract.
A generic source for every map property would not make sense for attributes.
Issue fork ui_patterns-3629254
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
just_like_good_vibesComment #4
pdureau commentedThe proposal is straigthforward: a new source plugin for:
field_granularity:itemrequirement)Tested with https://www.drupal.org/project/link_attributes (is there another way to test this?) It works.
But, it is not "perfect": an additional plugin deriver and a mechanism specific to a field type. It is the kind of source plugins whcih will not survive a UI Patterns 3.0 update.
Good enough for now though, mergeable.
Comment #6
just_like_good_vibes