page_add_script() does not work
-
lux
- State changed from new to invalid
If the box is being called from inside the template that's already being parsed (e.g., with
<xt:box />), then yes this will fail. You can pre-load things in a couple of ways though:- Boxed embedded in the page body can call
page_add_script()since the page body is parsed first. - You can add an initialization routine that calls these to
inc/conf/properties.php, which behaves the same as theconf/properties.phpfile for each app, but does so globally. - Add a
myapp/initbox call in the head of the template and load any scripts you need to for your app there. - Just load the scripts in place in the body of the page. There's no reason you can't load them in the body instead of the head, and that's actually encouraged for improving load times if you load whatever you can after the rest of the content so it all loads first for the user.
For more info on that last point, see:
-
Vojtech Jina
Sorry for invalid ticket, your sollution works fine. I didnt know it...
-
lux
No worries, glad it works for you :)
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.