Trying to add assets to bottom in function onTwigSiteVariables

Hi,

in my onTwigSiteVariables i try to load js or css in bottom group
that code work perfectly in <head> but i’m trying to add in bottom bottomjs

$assets = $this->grav['assets'];
$assets->registerCollection('mainjs', $main_js_array);
$assets->registerCollection('bottomjs', $bottom_js_array);
$assets->add('mainjs', 100);
$assets->add('bottomjs', 100);
---

See this post on the same topic. TLDR, your theme needs to have a bottom block defined.

@Perlkönig thanks a lot it’s exactly what i need