Typo3 eID how to access configuration

I just created an eID in Typo3. I cannot figure out how to access the configuration data of my plugin from an instance of Typo3.

I tried the code from the link, but it does not want to work. I get the exception "No TypoScript template found!" To the call "$ TSFE-> getConfigArray ();"

http://lists.typo3.org/pipermail/typo3-dev/2006-December/021392.html

Any ideas?

Thanks.

+6
source share
1 answer

In eID mode, only a small portion of the TYPO3 regular interface is loaded. Sorry, TypoScript is not loaded. To access TypoScript configuration, you need to manually download the components necessary for this. Unfortunately, this can be a bit of a pain in the butt. Therefore, in some cases it would be easier to just load a page containing one plugin that does not contain anything (without headers, etc.).

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

require_once(PATH_tslib.'class.tslib_fe.php'); require_once(PATH_t3lib.'class.t3lib_userauth.php' ); require_once(PATH_tslib.'class.tslib_feuserauth.php'); require_once(PATH_t3lib.'class.t3lib_cs.php'); require_once(PATH_tslib.'class.tslib_content.php') ; require_once(PATH_t3lib.'class.t3lib_tstemplate.php'); require_once(PATH_t3lib.'class.t3lib_page.php'); $TSFEclassName = t3lib_div::makeInstanceClassName('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']->connectToMySQL(); $GLOBALS['TSFE']->initFEuser(); $GLOBALS['TSFE']->fetch_the_id(); $GLOBALS['TSFE']->getPageAndRootline(); $GLOBALS['TSFE']->initTemplate(); $GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site; $GLOBALS['TSFE']->forceTemplateParsing = 1; $GLOBALS['TSFE']->getConfigArray(); $cObj = t3lib_div::makeInstance('tslib_cObj'); 

This initializes TSFE and cObj, but is also used to load and parse TypoScript templates. You may need to make some changes (maybe delete some things)

The code came from one of the comments on the next blog post: http://sebastiaandejonge.com/blog/articles/2010/september/21/bringing-ajax-to-your-frontend-plugins/

Good luck

+6
source

Source: https://habr.com/ru/post/899694/


All Articles