docs: function renderTemplate(resourceManager, req, res, channel,
                          templatePath, contextPath) {
  
      var gameName, gameSettings;
      var context, cb;
      var clientId, room, treatmentName;
  
      gameName = channel.gameName;
  
      // Build the right settings object to pass to the context callback.
      // By default, it is the 'standard' treatment. If we
      // can locate the client id (via signed cookie), and if the client id
      // is found in a room with a treatment, then use just the settings for
      // that particular treatment.
      treatmentName = 'standard';
      if (req.cookies && req.cookies.nodegame_token) {
          clientId = verifyToken(req.cookies.nodegame_token, channel.secret);
          if (clientId === false) {
              channel.sysLogger.log('GameRouter renderTemplate: failed to ' +
                                    'verify token ' + req.cookies.nodegame_token +
                                    ' in channel ' + gameName, 'error');
          }
          else {
              room = channel.registry.getClientRoom(clientId);
              room = channel.gameRooms[room];
              if (room) treatmentName = room.treatmentName;
          }
      }
      gameSettings = channel.gameInfo.settings[treatmentName];
  
      // Context is retrieved from cache,
      // and can be modified by user-defined callbacks.
      context = resourceManager.getContext(gameName, contextPath, gameSettings,
                                           req.headers);
  
      if (context) {
          res.render(templatePath, context);
          return;
      }
  
      fs.exists(contextPath, function(exists) {
          if (exists) {
              try {
                  cb = require(contextPath);
                  if ('function' !== typeof cb) {
                      throw new TypeError('GameRouter renderTemplate: context  ' +
                                          'callback must be function. Found: ' +
                                          cb);
                  }
              }
              catch(e) {
                  resourceManager
                      .servernode
                      .logger.error('GameRouter renderTemplate: error loading ' +
                                    'context file: ' + contextPath +
                                    ' ' + e.stack);
                  // TODO: Log error.
                  // TODO: Mark file as non-existing ?
                  res.status(404).send('File not Found');
                  return;
              }
              resourceManager.cacheContextCallback(gameName, contextPath, cb);
              context = cb(gameSettings, req.headers);
          }
          // Render anyway, with or without context.
          res.render(templatePath, context);
      });
  }