How to integrate Dojo Toolkit with TypoScript into Typo3

If you need the Dojo Toolkit within Typo3, you only need the following few lines TypoScript:

page.includeJS {

  # Dojo Configuraton
  file1 = fileadmin/templates/javascript/djConfig.js
 
  # Dojo-Libraries
  file3 = http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js
  file3.external = 1
  file3.type = text/javascript
}

 
In this case i’ve the Dojo configuration within a separate JavaScript file:

var djConfig = {
  parseOnLoad: true,
  locale: 'de'
};

 
But attention, as you know the configuration must be included before the Dojo-Library. Therefore the ‘file’-variable have a lower number.. 😉

In the next step we need to integrate all required CSS:

page.includeCSS {
  file2 = http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/nihilo/nihilo.css
  file2.external = 1
  file2.media = all
}

 
Attention: The included CSS must be external=1 and media=all!

Finally we have to include the Dojo-Theme class ‘nihilo’ into the Body-Tag. This can be done with the next TypoScript:

page.bodyTagCObject = HTML
page.bodyTagCObject.value = <body class="nihilo">

 
And that’s it.. Now you should be able to use Dojo within your Typo3 site. 🙂

  1. No comments yet.