This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi,
I have my layout with my call to a partial with a variable like :
{% partial "row" level="bottom" %}
and, in my partial I need to inject level value to a component :
{% component "mycomponent" code="{{ level }}" %}
But, {{ level }}
isn't interpreted : in my example, I need to have bottom instead of {{ level }}
.
How can I do that ?
Thanks
Last updated
Re, Finally, I use theme customization and test on my variables and it works (~ to concat is the truth :D).
The problem is you're not using twig variables correctly. once you specify {% ... %}
, everything in side there is part of Twig. Therefor, you don't need to use {{ ... }}
when you've already opened twig. Basically what you did was this...
<?php
<?= $level ?>
?>
See the problem? Reading the Twig documentation might help you solve these kinds of issues.
But for future reference, this is what you want to do here
{% component "mycomponent" code=level %}
Last updated
1-3 of 3