0
votes

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)

enter image description here

2

2 Answers

0
votes

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:

Select TypoScript Template

  • 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)

Select 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)

TypoScript TSOB tree

[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.

0
votes

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.