Typo3 eID, how to access config OR fetch template from ajax file

In eID mode, only a small part of the regular TYPO3 frontend is loaded. Unfortunately TypoScript is not loaded. To still access the TypoScript configuration you need manually load the components it needs to do so. Unfortunately this can be a bit of a pain in the butt. So in some cases it might be easier to just load a page containing a single plugin that doesn’t contain anything else (without headers etc.).

If you do want to load the TypoScript templates yourself, you can try something like the following:

<?php //if (!defined (‘TYPO3_MODE’))die (‘Access denied.’);


t3lib_div::requireOnce(PATH_t3lib.’class.t3lib_userauth.php’ );
t3lib_div::requireOnce(PATH_tslib.’class.tslib_content.php’) ;

$TSFEclassName = t3lib_div::makeInstance(‘tslib_fe’);
$id = isset($HTTP_GET_VARS[‘id’])?$HTTP_GET_VARS[‘id’]:0;

$GLOBALS[‘TSFE’] = new $TSFEclassName($TYPO3_CONF_VARS, $id, ‘0’, 1, ”,”,”,”);
$GLOBALS[‘TSFE’]->tmpl->getFileName_backPath = PATH_site;
$GLOBALS[‘TSFE’]->forceTemplateParsing = 1;

class CLASS_NAME {

  protected $uid;

  public function __construct() {
      $this->cObj = t3lib_div::makeInstance(‘tslib_cObj’);

  public function main() {
      $templateFile = ‘EXT:EXTENSION_NAME/pi1/view/template.html’;
      $template = $this->cObj->fileResource($templateFile);
      $subpart = $this->cObj->getSubpart($template, ‘###TEMPLATE###’);
      $subpartArray = $linkpartArray = array();
      return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray, $subpartArray, $linkpartArray);


$obj = t3lib_div::makeInstance(‘CLASS_NAME’);


// Make instance:


Good Luck….. πŸ™‚

If you have any query then feel free to contact me at Jainish Senjaliya

3 thoughts on “Typo3 eID, how to access config OR fetch template from ajax file

  1. Very helpful, thanks. Please note that the funtion connectToMySQL() is deprecated and not supported anymore in recent Typo3 Version. Use connectToDB() instead.

  2. $HTTP_GET_VARS is very old-fashioned and no more supported on many PHP environments. Use $_GET or use the appropriate function provided by Typo3: t3lib_div::_GP(‘id’)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s