‘Page Strategies’ encapsulate these variations. These are loaded from a separate repository, tal-page-strategies.

Using the page strategies repository

The TAL repository exposes a module known as AntieFramework as its Node.js entry point. AntieFramework contains methods to return the appropriate variant of each of the above properties. Each method takes a device configuration as a parameter, uses this to determine the page strategy, then uses the page strategy to determine the correct response.

TAL’s package.json includes the tal-page-strategies repository as a dependency, so the latest set will always be fetched by NPM - simply run npm install.

The code for AntieFramework can be found under node/antieframework.js. Using TAL in your Node.js application is a matter of defining it as a dependency in package.json:

"dependencies":{"tal":"fmtvp/tal"}

Then use AntieFramework from your own app using Node.js’s require mechanism:

If you do not wish to use Node.js in your application, it should be straightforward to replace the methods of AntieFramework with some other server side technology - remembering also to import the page strategy files from their repository as part of your build process.

An example index (NodeJS)

The TAL Example repository contains an example of how to use AntieFramework to build a simple index using nodejs.
The supplied code has been written for clarity, not elegance, but should be simple to adapt.

To create a new object you have to indicate the configPath. An example constructor using this variable might be: