Timeline for Passing Twig Variable into Template from Include?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Jan 9, 2019 at 10:17 | history | suggested | Dan Lee | CC BY-SA 4.0 |
amended answer so that a filter is added to the object
|
Jan 8, 2019 at 11:44 | review | Suggested edits | |||
S Jan 9, 2019 at 10:17 | |||||
Jan 8, 2019 at 11:42 | comment | added | Dan Lee | Figured it out needed to add |trim like so: {% set ratio = m.ratio(block) %} | |
Jan 8, 2019 at 11:42 | vote | accept | Dan Lee | ||
Jan 8, 2019 at 10:55 | comment | added | Dan Lee | Actually doing {{ dump(ratio) }} I get the following... object(Twig_Markup)#1692 (2) { ["content":"Twig_Markup":private]=> string(17) "imageVariants3by2" ["charset":"Twig_Markup":private]=> string(5) "UTF-8" } - Is there aw way to filter this? | |
Jan 8, 2019 at 9:05 | comment | added | Dan Lee | Ah ok so when I reference {% set optimizedImages = block.image.one()[ratio] %} I get an error that says 'illegal offset type'. Apparently, this happens when attempting to access an array index using an object. How do I amend? | |
Jan 7, 2019 at 19:19 | history | answered | Piotr Pogorzelski | CC BY-SA 4.0 |