This patch includes the node preview preprocess function in addition to a few tweaks to the existing node-preview.html.twig file. Not sure if I should include that with the patch or not. Most of the existing template has been retained, some of the logic for display has changed to account for different variables passed to the template.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | d8tts-node-preview-1822142-3.patch | 2.36 KB | EVIIILJ |
| #2 | d8tts-node-preview-preprocess-1822142-2.patch | 2.37 KB | steveoliver |
| node-preview.patch | 2.31 KB | EVIIILJ |
Comments
Comment #1
vlad.dancerGood job!
Comment #2
steveoliver commentedMaybe this would be just a little cleaner?
Comment #3
steveoliver commentedThis is what my patch addresses:
We always set variables.
Use unique variable names here.
Unnecessarily long variables name.
Cleanup @see syntax.
Unnecessary check, know variables should always be defined.
Comment #4
EVIIILJ commented@steveoliver: Thank you for clarifying all your suggestions. They all make perfect sense, in fact I was battling them myself initially while creating the first patch but elected to go with similarities from the original theme_node_preview function. I like the alternative you suggested as well :)
Great to know, I will adopt this standard in future conversions I take on.
Attached is an updated patch including the suggested changes.
Comment #5
steveoliver commentedThanks, EVIIILJ. Committed in 2b55585.
Comment #6
decafdennis commentedSee http://drupal.org/node/156119