Problem/Motivation

I have created a Twig Template for the Expert layout for a DS field. The suggestion and template work, however I have noticed that the $variables['settings'] which control Wrappers and such in the Expert field is not getting set as expected in the suggestions.

I did some digging looking at ds.module and it seems that in ds_theme_registry_alter(), specifically the Workaround code starting at Line 154, it appears that not all possible suggestions are being processed here. It seems that field--ds-field-expert--*.html.twig will have the Settings variable set correctly, but the actual suggestions which are: field--expert--* do not.

Steps to reproduce

  1. Start with a content type using a View Mode with a DS layout selected.
  2. Edit a Field to use the Expert field template.
  3. Create a custom Twig template based on the suggestions for that field (eg: field--expert--{field_name}.html.twig
  4. Clear cache, reload page. Any settings added to the Expert Wrappers will not load correctly.
  5. Use drupal dump to view the Settings variable, should return Null.

Proposed resolution

Initial ideas are to expand suggestions, or to update the Field Suggestion workaround to be more inclusive for all possible suggestion patterns.

Comments

TXChetG created an issue. See original summary.

swentel’s picture

Version: 8.x-3.9 » 5.0.x-dev
fallenturtle’s picture

I'm having this issue too.

swentel’s picture

Version: 5.0.x-dev » 8.x-3.x-dev
swentel’s picture

Status: Active » Closed (duplicate)