Access to .yaml in a .js

Hi All,

My need is quite simple but i can’t figure it out .

i am using {% do assets.addJs(‘theme://js/mynice.js’) %} and it’s well working. I would like to use in my .js my configuration setting.

How can i send or use in mynice.js the configuration setting from site.yaml or system.yaml or theme.yaml ?

Thanks for any help !

1 Like

i got it so i share it :

so did you find a working solution)? I have the same problem


you can override once loaded

script type="text/javascript"> 
var myparameter = '{{ config.theme.myparameter }}';  
-   and just use the  myparameter -

but finally i don’t use it for my personal case.