Hello. I have an issue.

I am trying to override ds-field-expert.html.twig in my custom theme.

In "Manage Display" I already configured anything and it works fine with ds-field-expert.html.twig (http://take.ms/DekZL).

I have following:

<!-- FILE NAME SUGGESTIONS:
   * field--expert--node--field-about--landingpage.html.twig
   * field--expert--node--landingpage.html.twig
   * field--expert--node--field-about.html.twig
   * field--expert--field-about--landingpage.html.twig
   * field--expert--landingpage.html.twig
   * field--expert--field-about.html.twig
   * field--expert.html.twig
   * field--ds-field-expert.html.twig
   * field--node--field-about--landingpage.html.twig
   * field--node--field-about.html.twig
   * field--node--landingpage.html.twig
   * field--field-about.html.twig
   * field--entity-reference.html.twig
   * field.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/ds/templates/ds-field-expert.html.twig' -->

In ds-field-expert.html.twig the module has:
{% if settings.ow %} - it is "Outer wrapper", in my case settings.ow == 1!

However, if I trying to copy ds-field-expert.html.twig to field--expert--landingpage.html.twig, the site has "settings== NULL" and the result is broken (http://take.ms/sf9bc), in additional I noticed the template_preprocess_ds_field_expert() was ignored.

It is weird.

<!-- FILE NAME SUGGESTIONS:
   * field--expert--node--field-about--landingpage.html.twig
   * field--expert--node--landingpage.html.twig
   * field--expert--node--field-about.html.twig
   * field--expert--field-about--landingpage.html.twig
   x field--expert--landingpage.html.twig
   * field--expert--field-about.html.twig
   * field--expert.html.twig
   * field--ds-field-expert.html.twig
   * field--node--field-about--landingpage.html.twig
   * field--node--field-about.html.twig
   * field--node--landingpage.html.twig
   * field--field-about.html.twig
   * field--entity-reference.html.twig
   * field.html.twig
-->
<!-- BEGIN OUTPUT from 'themes/easydrupal/templates/field--expert--landingpage.html.twig' -->

Even if I copied without renaming (leave as is field--expert.html.twig) the result the same and my page is broken.

However, if I am renaming to "field--ds-field-expert.html.twig" - looks good.

Should I add extra code to my theme or is it a bug?

Thank you.

Comments

Ruslan P created an issue. See original summary.

Ruslan Piskarov’s picture

Issue summary: View changes
Ruslan Piskarov’s picture

Issue summary: View changes
swentel’s picture

Status: Active » Closed (duplicate)

No, it's not your fault, we have a bug here. Closing in favor of #2856283: Overridden twig field templates have empty content