This article is covered in detail in the “doc_core_tsref” here:
In short we can easily include a script in two ways.
Both these code must be written in the setup section of a template record.
- Using the CONFIG object.
config.includeLibrary = fileadmin/templates/myscript.php
- Using the PAGE object.
page.100.file = fileadmin/templates/myscript.php
That should do the trick. Fo more info I suggest that you please refer “doc_core_tsref“.