Part of meta-issue #1788918: [GTD] [META] Prepare for Twig main engine core inclusion until December 1
For now, let's leave all the variable names the same as they are - just to get things working. To do that, there are several good rules of thumb for renaming variables:
1) remove all dollar signs from the front of variables.
print $title; becomes {{ title }}
2) remove all square brackets and quotes (for arrays) and replace with a period.
print $content['links'] becomes {{ content.links }}
3) remove all arrows (for objects) and replace with a period.
print $node->nid; becomes {{ node.nid }}
Longer term, we do have a problem with inconsistencies of how variables are named.
Two problems we face are:
- inconsistent mixtures of data and attributes (see #1783156: [meta] Clean up inconsistent mixtures of data and attributes)
- should we name top level items? (see #1783136: should we (re)name top level data items in templates?)
Comments
Comment #0.0
jenlamptonadded link to other issue
Comment #0.1
jenlamptonformting cleanup
Comment #0.2
jenlamptonadd link to attributes issue
Comment #0.3
jenlamptonadded see, and P tags
Comment #0.4
jenlamptonadded brs
Comment #1
bstoppel commentedtagging
Comment #1.0
bstoppel commentedmore brs
Comment #2.0
(not verified) commentedUpdated issue summary.