Results 1 to 4 of 4

Thread: Javascript in BE

  1. #1

    Default Javascript in BE

    Hi,

    Does someone know how to add javascript code and css code in the backend?
    I know that we can use $GLOBALS['TL_JAVASCRIPT'][] to do so, but with this global value it is only possible to add a file and not some code. I want to dynamically create my javascript and css script based on data in the database.

    I also tried $GLOBALS['TL_HEAD'][], but it looks like this variable is not available in the BE

    thanx

  2. #2

    Default Re: Javascript in BE

    And again I found the solution myself.

    You can only add CSS code and javascript code by using the hook: outputBackendTemplate
    With this hook you can inject your Css or Javascript code (see isotope tl_iso_orders)

  3. #3
    User
    Join Date
    06-19-09.
    Posts
    328

    Default Re: Javascript in BE

    Quote Originally Posted by freeyland
    And again I found the solution myself.

    You can only add CSS code and javascript code by using the hook: outputBackendTemplate
    With this hook you can inject your Css or Javascript code (see isotope tl_iso_orders)
    you can also create a "standalone" php script that ouput javascript
    (take a look at contao/files.php) and add its path to $GLOBALS['TL_JAVASCRIPT']
    Consulenza Contao CMS https://www.intco.it

  4. #4

    Default Re: Javascript in BE

    Thank you!!!!!
    I forgot about this one

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •