typo3 read configuration options in typoscript - typo3

I've tried several approaches to read the configuration options of my plugin in typoscript, but none of them seem to work
ajax.30 = TEXT
ajax.30.value = {plugin.tx_parser.settings.numVar}
ajax.40 < {tx_parser.settings.numVar}
ajax.50 < {tx_parser.settings.numVar}
ajax.80 = TEXT
ajax.80.value = {options.numVar}
ajax.90 = TEXT
ajax.90.value = {settings.numVar}
Can anyone please explain me the syntax or post a link where it is explained; I can use ext_conf_template.txt explained here https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/ConfigurationOptions/Index.html but I didn't get these options in typoscript.
All I want is to access (in typoscript) the configuration options of the following picture
If I browse Constants I don't see any of these options
If I add my plugin to the site I see some plugin options but none of them I wanted

You can use constants with this syntax in TypoScript setup or constants
var = {$plugin.tx_parser.settings.numVar}
So in your case:
ajax.30 = TEXT
ajax.30.value = {$plugin.tx_parser.settings.numVar}
See https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/UsingSetting/Constants.html
To assign an earlier declared setup value you would use the < (object copy) operator
ajax.30 = TEXT
ajax.30.value < plugin.tx_parser.settings.numVar
Here is an on overview of its syntax: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/TypoScriptSyntax/Syntax/TypoScriptSyntax.html
The difference between constants and setup is essential. You can check in the backend in the module Template -> Template browser - see https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/UsingSetting/Debugging.html

Related

How to show paths for auto imports with neovim nvim-cmp

Using neovim with nvim-cmp in ecmascript/typescript I want the menu to show 2 things that are not there by default.
If it's a local module, show the path.
If it's an import from a library, show the library name. (preferably in different color/font/icon than import from local component).
The docs shows a few examples of how to setup icons, but not how to show paths.
You can achieve something similar by adding these lines in the format function while calling nvim-cmp's setup:
if entry.completion_item.detail ~= nil and entry.completion_item.detail ~= "" then
vim_item.menu = entry.completion_item.detail
else
vim_item.menu = ({
nvim_lsp = "[LSP]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
})[entry.source.name]
end
result:

TYPO3 9.5.4 (with slug) ignores get parameter 'type'

I want to switch the type of my typo3 website e.g. for xml or json output, but the system ignores the get parameter type. I don't know what I'm doing wrong or if there is a bug.
typoscript example
testtype = PAGE
testtype.typeNum = 13
testtype.10 = TEXT
testtype.10.value = test
testtype.config.disableAllHeaderCode = 1
my site config
https://pastebin.com/UsdZGq7N
You make use of the PageType routeEnhancer, when that is active you have to map all the page-types you use. Otherwise it gets stripped from the url.
Also, the PageType routeEnhancer should be the last enhancer you configure, as it modifies existing route variants:
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Routing/Enhancer/PageTypeDecorator.php#L25

Editing Typo3 CMS front-end page

I get a project that used TYPO3 CMS, the task is quite simple, adding cookie usage notice on the header part of the website.
I never working on TYPO3 before, but already reading the documentation. Somehow I can't figure out which file to edit. even the documentation tutorial and file structure is different than the project I handle.
I don't have any project documentation for the project either, and I don't want to ask you to do my task, but I'm blank at the moment and don't know where to find the respective file needed.
Any suggestion or clue how to handle the issue?
my index.php on root folder look like this:
if (defined('E_DEPRECATED')) {
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
} else {
error_reporting(E_ALL ^ E_NOTICE);
}
// ******************
// Constants defined
// ******************
define('PATH_thisScript', str_replace('//', '/', str_replace('\\', '/',
(PHP_SAPI == 'fpm-fcgi' || PHP_SAPI == 'cgi' || PHP_SAPI == 'isapi' || PHP_SAPI == 'cgi-fcgi') &&
($_SERVER['ORIG_PATH_TRANSLATED'] ? $_SERVER['ORIG_PATH_TRANSLATED'] : $_SERVER['PATH_TRANSLATED']) ?
($_SERVER['ORIG_PATH_TRANSLATED'] ? $_SERVER['ORIG_PATH_TRANSLATED'] : $_SERVER['PATH_TRANSLATED']) :
($_SERVER['ORIG_SCRIPT_FILENAME'] ? $_SERVER['ORIG_SCRIPT_FILENAME'] : $_SERVER['SCRIPT_FILENAME']))));
define('PATH_site', dirname(PATH_thisScript).'/');
if (#is_dir(PATH_site.'typo3/sysext/cms/tslib/')) {
define('PATH_tslib', PATH_site.'typo3/sysext/cms/tslib/');
} elseif (#is_dir(PATH_site.'tslib/')) {
define('PATH_tslib', PATH_site.'tslib/');
} else {
// define path to tslib/ here:
$configured_tslib_path = '';
// example:
// $configured_tslib_path = '/var/www/mysite/typo3/sysext/cms/tslib/';
define('PATH_tslib', $configured_tslib_path);
}
if (PATH_tslib=='') {
die('Cannot find tslib/. Please set path by defining $configured_tslib_path in ' . htmlspecialchars(basename(PATH_thisScript)) . '.');
}
// ******************
// include TSFE
// ******************
require (PATH_tslib.'index_ts.php');
edit: adding screenshot of the interface suggested by #Riccardo (typo3 ver 4.4.4)
Which version of TYPO3 are you running? As Bernd wrote, it is difficult to help you without further information.... I'll try to explain the first passages where you could gather some infos.
1) Access TYPO3 backend with a user with administrative privileges
2) Try to identify the main TypoScript template with this procedure:
click on template (1)
click on the "zero" page with the TYPO3 symbol (2)
you should see on the right a list of the TypoScript templates (3),
click on the one that is marked as "is Root"
2) After that, click on the first dropdown on the right area (with the "info/modify" item and select "TypoScript Object Browser" (a.k.a. TSOB)
3) After you have done that, you should see a "tree" that represents the TypoScript configuration;
be sure to have "setup" selected (1)
search for the object that builds your page, which should most likely be page = PAGE (2)
[answer edited]
I'm afraid I'll have to ask for a survey supplement
Can you identify in which part of the various objects the header of your site is rendered? My suspects would be focused on the [home2] or the [outer_frameset] object;
Hoping that they will contain the usual array with something like:
home2.10 = something
I think that the quickiest (and dirtiest) way to append something before the whole page would be something like
home2.1 = TEXT
home2.1.value = <div>whatever your message would be </div>
I don't know if you need something more complex than that...
Said that, I admit I never worked with frame inside TYPO3 and I think that the last time I did something with frames was...uh... maybe 9 years ago.
Don't change that index.php!!
As it is part of the core which gets overwritten on an update of TYPO3.
As there are very much options for configurating a page there can be no recipe matching all.
My best tip: get a TYPO3 profi to have a look into your installation so he can find which files are responsible for the page rendering and could include the cookie notice.
There also are some extensions which could render such a notice in your pages in a very easy way. But that all depends how your installation is configured. Nothing to say without further knowledge.

decreaseIndentPattern has no effect

I am trying to create a TextMate bundle for a new language but am having issues with the decreaseIndentPattern. It seems to have no effect whatsoever, even with a trivial example:
increaseIndentPattern = 'start';
decreaseIndentPattern = 'end';
I have set the scope correctly and the other settings in the same file do work (including the increaseIndentPattern). Am I missing something?
Found out that to enable indentation correction on text based files (my scope starts with text), the following is also required:
disableIndentCorrections = :false;

Typo3 eID, how to access config

I've just created an eID in Typo3. I can't figure out how to access the config data for my plugin from the Typo3 instance.
I've tried the code from the link but it doesn't want to work. I keep getting an exception "No TypoScript template found! " on the call " $TSFE->getConfigArray(); "
http://lists.typo3.org/pipermail/typo3-dev/2006-December/021392.html
Any ideas?
Thanks.
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:
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 the TSFE and cObj but is also used to load and parse the TypoScript templates. You might need to make some modifications to (probably kick some things out)
The code came from one of the comments on the following blog post: http://sebastiaandejonge.com/blog/articles/2010/september/21/bringing-ajax-to-your-frontend-plugins/
Good luck!