Warn about node--view suggestions that do not work

Created on 7 October 2024, about 1 year ago

API page: https://api.drupal.org/api/drupal/core%21modules%21views%21views.theme.i...

When a view is set to render nodes as content, Drupal produces template suggestions for the nodes that cease to work once caching is turned on. This can really ruin your day if you have not completely tested the site with caching turned on.

Until the issue is fixed, add a warning to the views template documentation (I can't find anywhere else to put this):

WARNING:
When a view is set to render nodes as "Content," you may see template suggestions for each node in the form: "node--view--VIEW-NAME--VIEW-ID.html.twig" and "node--VIEW-NAME.html.twig". Do not use these theme suggestions. They will stop working once you turn on caching for the site. See https://www.drupal.org/node/2728419 β†’ for a discussion of the issue.

πŸ“Œ Task
Status

Active

Version

10.3 ✨

Component

documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States gbirch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @gbirch
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.

  • Status changed to Closed: duplicate 4 months ago
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    I'm closing this as a duplicate, we can now properly deprecate those suggestions in the other issue, reviews welcome. This will be much more visible than documenting this somewhere that doesn't even mention those theme suggestions at the moment.

  • πŸ‡ΊπŸ‡ΈUnited States gbirch

    gbirch β†’ changed the visibility of the branch 3479114-warn-about-node--view to hidden.

  • πŸ‡ΊπŸ‡ΈUnited States gbirch

    Thanks for fixing this!

Production build 0.71.5 2024