Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Trying to add assets to bottom in function onTwigSiteVariables

Started by Muut Archive 10 years ago · 2 replies · 404 views
10 years ago

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

PHP

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

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

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1360 9 years ago
Archive · by Muut Archive, 9 years ago
2 938 9 years ago
Archive · by Muut Archive, 9 years ago
2 4068 9 years ago
Archive · by Muut Archive, 9 years ago
1 2958 9 years ago
Archive · by Muut Archive, 9 years ago
3 1122 9 years ago