martin-wessel-topfloor / Field-Markup

A Drupal 7 module that extends Display Suite by exposing the Expert field markup settings in a JSON file.
0 stars 0 forks source link

Rename `label` to `title` and allow it only under the `title-markup` key #7

Open martin-wessel-topfloor opened 9 years ago

martin-wessel-topfloor commented 9 years ago

right now it;s possible to change the title of a field by using the label:field title structure anywhere in the JSON, but label isn't immediately obvious and allowing it anywhere can lead to confusion if more than one title is set. Putting it inside title-wrapper also enforces it's connection to other title markup.

Since this changes a key, it's likely to break backwards compatibility.

martin-wessel-topfloor commented 9 years ago

It might be possible to keep backwards compatibility if the tf_functions_load_json function is updated to allow altering the array before it is saved. A hook could be implemented in field_markup that scans through the array looking for label, renaming it title, and moving it under the title-markup key at the same level as the original label key. This may mean adding a new title-markup key.