I've created a preprocess function in addition to the twig template, however I'm unable to test locally due to errors (attached screenshot)
Fatal error: Maximum function nesting level of '100' reached, aborting! in /Users/jason/Sites/1750250/core/includes/bootstrap.inc on line 2655
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 1815636-image-widget-4.patch | 1.86 KB | EVIIILJ |
| #5 | 1815636-image-widget-3.patch | 1.77 KB | EVIIILJ |
| #3 | 1815636-image-widget-2.patch | 1.77 KB | EVIIILJ |
| #1 | 1815636-image-widget.patch | 1.74 KB | EVIIILJ |
| #1 | Screen Shot 2012-10-17 at 9.17.30 AM.png | 119.13 KB | EVIIILJ |
Comments
Comment #1
EVIIILJ commentedI forgot the screenshot :(
While I'm at it here is the patch including the template preprocess function in addition to the image-widget.html.twig template.
Comment #2
EVIIILJ commentedComment #3
EVIIILJ commentedFixed code spacing from tabs to spaces.
Comment #4
decafdennis commentedThe line containing
endifhas an extraneous space at the beginning of the line / has a different indentation than the matchingifline.Comment #5
EVIIILJ commentedThank you for the feedback. Attached is an updated patch which eliminates the extra space.
Comment #6
decafdennis commentedThanks :)
Comment #7
podarokwe do not need extra space before
spanhere' <span class="file-size">why minus ?
-attributesdid I missing here something?
Comment #8
vlad.dancerreplace template_preprocess to image_preprocess
Replace this to Attributes.
Example: http://drupal.org/files/1807166-textarea-twig-4.patch
Need doc update.
Please, read this
Why did u used minus here, have i missed something too?
Comment #9
EVIIILJ commented[1] Not sure I'm following why we need to change template_preprocess to image_preprocess. Can you clarify?
[2] Attributes have been converted to using the Attribute Class.
[3] Updated docs.
[4] the minus was a typo in an attempt to use the white space control available to the Twig engine
A patch is included with the updated docs, use of Attribute class and fixing the white space control. Both the template and preprocess function are included.
Comment #10
vlad.dancer@EVIIILJ
I've learned this post about template vs/ module/theme preprocess and agree with you about template_preprocess, but i've prefered module_preprocess for myself.
Comment #11
podarok#9 thanks for pointing to docs about whitespace control
+1 RTBC
Thanks!
commited / pushed to front-end