Follow-up to #2342287: Allow Twig in Views token replacement:

  • The UI refers to a list of tokens as "Twig tokens", but it can include both the Twig-compatible render (field) tokens, and non-Twig-compatible argument tokens.
  • In the field rewrite form, the UI tells the user that "HTML or Twig" can be entered, but a site builder would not necessarily know what Twig is.

Proposed resolution

  • Remove the UI reference to "Twig" in the token list.
  • Link the field rewrite reference to "Twig" to the Twig documentation.

Beta phase evaluation

Unfrozen changes Unfrozen because it only changes UI text (translatable strings).
Disruption No disruption.

Remaining tasks

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Manually test the patch Novice Instructions
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards Novice Instructions

User interface changes

The word "Twig" is now linked in the field rewrite help text:

The word "Twig" is removed from the token list description:

API changes


#5 vdc-twig-ui-2414685-5.patch2.24 KBmikeker
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 85,562 pass(es). View
vdc-twig-strings.patch2.51 KBxjm
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch vdc-twig-strings.patch. Unable to apply patch. See the log in the details link for more information. View
twig_docs_link.png25.46 KBxjm
token_list_after.png15.54 KBxjm
tokens.png27.63 KBxjm
Members fund testing for the Drupal project. Drupal Association Learn more


xjm’s picture

Issue summary: View changes
Cottser’s picture

Status: Needs review » Reviewed & tested by the community

Absolutely. Thanks!

mikeker’s picture

+1. Thanks, xjm!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, vdc-twig-strings.patch, failed testing.

mikeker’s picture

2.24 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 85,562 pass(es). View

Reroll. Drupal\Core\Url was added as part of #2368653: Replace _l in all places (3) besides one., though I'm not sure why it was renamed to CoreUrl as it doesn't conflict with anything...

xjm’s picture

Status: Needs work » Needs review
xjm’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

UI strings are not frozen yet. Committed 621d9bf and pushed to 8.0.x. Thanks!

  • alexpott committed 621d9bf on 8.0.x
    Issue #2414685 by xjm, mikeker: Improve references to Twig tokens in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.