Study guide · Web and PHP Basics

The integrator's toolkit – HTML, CSS, JavaScript, PHP, YAML and CSV

As of November 15, 2026 · TYPO3 14.3 LTS · about 26 min read

TYPO3 is built on web technologies that you, as an integrator, need to read and carefully change. On this page you follow Mara, who builds the website of the Lindenau Music School. Along the way you meet HTML, CSS, JavaScript, a little PHP, YAML and CSV. By the end you also know the basic rules on copyright and data protection and the formatting rules of the TYPO3 project.

The skeleton of a page: HTML

Mara works in a Composer project with TYPO3 14.3. Her site package is called lindenau_site, and the Composer package is lindenau/site.

HTML stands for HyperText Markup Language. It describes the structure and content of a web page with elements such as headings, paragraphs, links and images. A valid document always has the same basic frame:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Lindenau Music School</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <header>
      <nav><a href="/courses">Courses</a></nav>
    </header>
    <main>
      <h1>Welcome to the music school</h1>
    </main>
    <footer>Legal notice</footer>
  </body>
</html>
Code example. An HTML document with a doctype and a head with character set, title and stylesheet. The body holds a header with navigation, a main area with a heading, and a footer.
  • The document starts with the doctype for HTML.
  • The head appears exactly once in the document. It holds metadata such as the character set and the title, which the browser shows in the tab.
  • The body also appears exactly once. It holds everything visitors see.

Headings range from h1 to h6. The element h1 marks the most important heading of the page. Below it you structure the content sensibly downwards with h2, h3 and so on. Do not confuse it with head, the head of the document, or with header, the top area of the visible page.

Links are created by the element a, with the attribute href for the target. The element link, on the other hand, is not a clickable link. It includes resources in the head, for example a stylesheet.

Semantic elements describe the meaning of an area. There is header for the top area, nav for navigation, main for the main content, article for a self-contained post and footer for the bottom area. Search engines and screen readers understand the page better this way. Elements such as font and center used to define presentation only and are now outdated.

Images need the attribute alt. It provides a text replacement when someone cannot see the image or it does not load. Screen readers read this text aloud. This is a core part of accessibility.

Forms need labels that are connected to their field. The element label gets the id of the input field in its attribute for:

<label for="email">Email address</label>
<input type="email" id="email" name="email">
Code example. A label with for set to email belongs to the input with the id email.

This way you can click the label to jump into the field, and screen readers read it out together with the field.

Presentation with CSS

CSS stands for Cascading Style Sheets. CSS defines how HTML looks, that is colours, fonts, spacing and layout. You include an external CSS file in the head of the page with the element link and the attribute rel set to stylesheet. You can see the line in the basic frame above. In TYPO3, Mara often leaves this to the ViewHelper f:asset.css in the template or to the TypoScript setting page.includeCSS.

A CSS rule consists of a selector and declarations. The selector decides which elements are meant:

  • An element selector such as p matches all paragraphs.
  • A class selector starts with a dot. So .teaser matches all elements with the class teaser.
  • An ID selector starts with a hash. So #main matches the one element with the ID main.
  • The universal selector, an asterisk, matches everything.
  • The at sign starts special rules, for example @media for rules per screen size.

Cascading means that several rules can match the same element, and the browser decides which declaration applies. Importance, specificity and order all count.

Two rules match the same element 1 Importance !important beats normal declarations 2 Specificity Inline style style="…" ID #teaser Class .box Element p Asterisk * (none) stronger weaker 3 Order only on a tie: the later rule wins #teaser p beats .box p, whatever comes first.
How the browser decides which of two rules applies.

Specificity decides before order. ID selectors are more specific than classes, and classes are more specific than elements. The asterisk has no specificity at all. A style written directly on the HTML element, an inline style, ranks above all selectors.

.box p { color: red; }
#teaser p { color: blue; }
Code example. The first rule matches paragraphs inside elements with the class box and colours them red. The second matches paragraphs inside the element with the ID teaser and colours them blue.

Only with equal specificity does the rule defined later win. That is why the order of the CSS files matters too. With !important, a declaration overrides normal rules. Use it sparingly, because it makes maintenance harder. Many properties, such as the text colour, are also inherited by child elements.

The box model describes the space an element takes up. From the inside out there are four layers.

margin · outer spacing border padding · inner spacing Content From inside out: content, padding, border, margin.
The box model from the inside out.
  • padding is the inner spacing between content and border.
  • border is the frame around it.
  • margin is the outer spacing to neighbouring elements.

Interaction with JavaScript

JavaScript usually runs in the visitors' browser, not on the web server and not in the database. It makes pages interactive, for example a drop-down menu or a check in a form.

To react to a click you use the method addEventListener(). It registers a function for an event, for example click. You may attach several such functions to the same element.

const button = document.querySelector('#menu-toggle');
button.addEventListener('click', () => {
  document.querySelector('nav').classList.toggle('open');
  console.log('Menu toggled');
});
Code example. A constant fetches the menu button. On a click, a function toggles the menu and writes a message to the console.

You declare variables with const, let or var:

  • A variable declared with const cannot be reassigned. An object inside it stays changeable, though, so you can still change its properties.
  • let and const are only valid in the enclosing block, for example inside a loop.
  • var is the old way. It is valid for the whole function, not just the block.

Debugging: With console.log() you write a value to the console of the developer tools. The commands echo and print, by contrast, come from PHP. JavaScript errors appear in the browser console as well. You can also set breakpoints there. You will not find them in the TYPO3 log or in the log files on the server, because the code ran in the browser.

In Fluid, Mara includes the script with the ViewHelper f:asset.script and sets the argument defer there. Without the argument priority, the script also ends up at the end of the body. With priority it goes into the head of the page. The classic TypoScript way is page.includeJS.

<f:asset.script identifier="menu" src="EXT:lindenau_site/Resources/Public/JavaScript/Menu.js" defer="1" />
Code example. The ViewHelper asset.script with the identifier menu includes the file Menu.js from the site package lindenau_site and loads it with defer.

Reading PHP: variables, types and arrays

You meet PHP in configuration files, above all in settings.php and additional.php in the folder config/system. You need to be able to read them and change them carefully.

Variables in PHP start with a dollar sign, for example the variable title. In TYPO3 you mostly meet the big global array for the configuration, TYPO3_CONF_VARS for short.

PHP knows these data types, among others:

  • string for text, in quotes. The 14 in quotes is a string.
  • int for whole numbers. The 14 without quotes is an integer, so it is a different type.
  • float for decimal numbers.
  • bool for truth values, that is true or false.
  • array for lists of values. An array is not a string.
  • null stands for “no value”.

In settings.php, numbers appear partly as text and partly as numbers. The file permissions 0664, for example, are written as a string so that the leading zero is kept.

An array stores several values. An indexed array numbers them from zero. An associative array uses keys. Key and value are joined by an equals sign followed by a greater-than sign, the so-called double arrow. Arrays can be nested. This is exactly how settings.php is built.

['name' => 'TYPO3', 'version' => 14]

<?php
return [
    'SYS' => [
        'sitename' => 'Lindenau Music School',
    ],
    'BE' => [
        'fileCreateMask' => '0664',
    ],
];
Code example. At the top, an associative array with the keys name and version. Below it, settings.php returns a nested array with return, with the site name under SYS and the file permissions 0664 as a string under BE.

Why return? The file settings.php returns a configuration array with return. TYPO3 includes the file and reads this array. Many configuration files of extensions work the same way, for example the files in the folder Configuration.

Merging arrays: The function array_merge() joins arrays together. If two arrays share the same string key, the later value overwrites the earlier one. There is no error and no duplicate key. Since PHP 8.1, the spread operator with three dots behaves the same way for string keys.

array_merge(['a' => 1, 'b' => 2], ['b' => 3]);
// Result: ['a' => 1, 'b' => 3]

[...$defaults, ...$overrides];
Code example. array_merge combines an array with a equal to 1 and b equal to 2 with an array with b equal to 3. The result has a equal to 1 and b equal to 3. The notation with three dots gives the same result.

Understanding PHP: conditions, functions and namespaces

In additional.php, Mara chooses values per application context, that is depending on whether the site runs in development or production. PHP uses conditions for this:

  • if checks a condition and runs code depending on the result. This works in configuration files too.
  • switch compares a value with several case branches. The comparison is loose, as with two equals signs. Without break, switch falls through to the next branch.
  • match compares strictly, as with three equals signs, and returns a value. There is no falling through to the next branch with match.
$context = (string)\TYPO3\CMS\Core\Core\Environment::getContext();
$GLOBALS['TYPO3_CONF_VARS']['SYS']['displayErrors'] = match ($context) {
    'Development' => 1,
    default => 0,
};
Code example from additional.php. The variable context gets the application context as text. match returns 1 for Development and 0 for everything else. The result goes into the setting displayErrors under SYS.

Functions and methods: You call a function directly, for example strlen() for the length of a text. A method belongs to an object. You call it on the object with an arrow made of a hyphen and a greater-than sign. Static methods are called on the class with two colons, like getContext() above.

strlen($text);
$site->getSettings();
Code example. strlen with the variable text is a function call. getSettings on the variable site is a method call on an object.

Parse error: TYPO3 loads a file such as additional.php on every request, in the frontend and in the backend. If a semicolon is missing, PHP stops with a parse error before TYPO3 can output anything. Then the whole website shows an error. Flushing the cache does not help here. Check changes beforehand on the command line with the php command and its syntax check option, that is php -l followed by the file name.

Namespaces give classes unique names. Two classes may have the same name as long as their namespaces differ. You declare it with the keyword namespace at the start of the file. In extensions it usually follows the vendor and the extension name. So Mara's classes live in the namespace Lindenau, backslash, Site.

Fluid namespaces: Mara writes her own ViewHelper and wants to use it in all templates under the prefix lindenau. Since TYPO3 14.1 she registers it globally in the file Configuration/Fluid/Namespaces.php of her extension. The file returns an array of prefixes and PHP namespaces. TYPO3 reads these files from all loaded extensions and merges them.

<?php
return [
    'lindenau' => ['Lindenau\\Site\\ViewHelpers'],
];
Code example. The file Namespaces.php returns an array. The prefix lindenau points to the namespace Lindenau Site ViewHelpers.

YAML: indentation is structure

TYPO3 uses YAML in many places. These include the site configuration in the file config.yaml of each site, route enhancers, site sets, the Form Framework and the presets of the rich text editor.

In YAML, indentation and colons define the structure. A key comes before a colon, followed by the value. Whatever is indented further belongs to the entry above it. There are no semicolons and no curly braces around blocks.

# Site of the Lindenau Music School
rootPageId: 1
base: 'https://www.musikschule-lindenau.example/'
dependencies:
  - lindenau/site
languages:
  - title: 'English: main language'
    languageId: 0
    locale: en_GB.UTF-8
Code example from the config.yaml of the music school. First a comment, then the start page and the domain. Under dependencies there is a list with the site set of the site package. Under languages there is one language whose title contains a colon and is therefore in quotes.
  • Indentation uses spaces only. Tabs are not allowed in YAML. TYPO3 uses 2 spaces per level.
  • Lists are written with a hyphen and a space before each entry, each entry on its own line and equally indented. There is also a short form in square brackets.
  • Comments start with a hash. YAML ignores everything after it, unless the hash is inside quotes.
  • Quotes are a good idea around texts with a colon. Otherwise a colon followed by a space in a value can be read as a new key.

TYPO3 adds its own helpers to YAML. With imports you include other YAML files. Placeholders with env read values from environment variables. Other placeholders take a value from the same configuration.

Correct languages: - title: English locale: … base: / base applies to the site Indented too far languages: - title: English locale: … base: / base is now a language key Valid YAML, but the site has no base URL.
A few spaces too many silently change the meaning.

Know the difference from TypoScript: in YAML, indentation means structure. In TypoScript, dots and curly braces form the structure, and indentation is only there for readability.

CSV: tables as text

The music school wants to take over its teachers from a spreadsheet. CSV is the common format for this, short for comma-separated values. Despite the name, other separators are common too.

A CSV file is a plain text file. Each line is a record. A separator divides the fields. Because it is just text, you can open the file with any text editor. A spreadsheet program shows the values in columns.

Separators: Comma, semicolon and tab are common. A dot or a hyphen is not a common separator. Which character a program uses also depends on the region. German spreadsheet programs often use the semicolon, because there the comma is the decimal separator.

Enclosure character: If a value itself contains the separator, you wrap it in an enclosure character, usually the double quote. The name Miller, John thus stays a single field. If the value itself contains a double quote, that quote is doubled. This is what RFC 4180 specifies. Some programs allow an escape character such as the backslash instead.

Teacher,Instrument,Device
"Miller, John",Piano,"12"" monitor"
Code example. A header line with teacher, instrument and device. The first value Miller, John is in quotes because it contains a comma. The device is called 12 inch monitor. The inch sign in the value is doubled, and the whole value is in quotes.

Encoding: Older programs often export ISO-8859-1, also called Latin-1. Modern programs use UTF-8. If a program reads the file with the wrong encoding, umlauts and other special characters are displayed incorrectly.

CSV in TYPO3: In the Records module you can download the records of a table. For CSV, the download offers three separators: comma, semicolon and the vertical bar, called pipe. As enclosure characters there are the double quote, the single quote and the space. The defaults are comma and double quote. Instead of CSV you can also choose JSON.

Copyright, data protection and AI

Photos are protected by copyright. Before Mara puts a third-party photo on the website, she checks whether the music school has the rights to use it. You need a licence or permission, and you often have to name the author. A photo on the internet is not automatically free.

Creative Commons are widely used free licences. The licence CC BY allows use on one condition: you name the author and the licence. So CC photos are not in the public domain. Other variants restrict more. NC, for example, forbids commercial use, and ND forbids adaptations.

Personal data is any information that can be attributed to a person. This includes name, email address and IP address, not just passwords or bank details. Data protection rules such as the GDPR apply to it. The legal details depend on the country. In a TYPO3 project this means:

  • IP addresses in logs and records can be personal data. The Scheduler offers a task that anonymizes IP addresses in database tables.
  • Form input, such as name and email when signing up for a trial lesson, is personal data.
  • Data in the backend can be personal too, for example the user accounts of the teachers.
  • You store data only as long as necessary. For old file uploads from forms there is the console command form:cleanup:uploads.

External resources are a delicate matter. If Mara embeds a font or a video from a foreign server, each visitor's browser sends their IP address to that server while loading. So the IP address goes to third parties. This can make consent necessary. Often it is easier to ship the font locally in the site package.

AI content must be checked before publishing. An AI text can contain false facts, even when it sounds convincing. It can also take over third-party texts almost word for word. A purely machine-generated text is not automatically protected by copyright either. The German Federal Office for Information Security recommends never taking over results unchecked.

Order in the code: the coding guidelines

The TYPO3 project has coding guidelines for the file formats you work with every day. They define file extensions and indentation:

  • TypoScript files must end in .typoscript. In static templates they are called constants.typoscript and setup.typoscript.
  • TSconfig files end in .tsconfig. They use the TypoScript syntax.
  • TypoScript, TSconfig, YAML and XLIFF are indented with 2 spaces per level, not with tabs.
  • PHP files follow the standard PSR-12. It governs, for example, indentation with 4 spaces, braces and namespaces. This also applies to PHP files in the site package. The package typo3/coding-standards now checks against PER Coding Style, the continued successor of PSR-12.
  • JavaScript in extensions is indented with 2 spaces instead of tabs, and strings use single quotes.

XLIFF is the standard format for language files in extensions, with the file extension xlf. The source texts live, for example, in locallang.xlf. Each translation sits in its own file with the language code as a prefix, so the German one is called de.locallang.xlf. Since TYPO3 14.1, the Core indents all XLIFF files with 2 spaces instead of tabs. Extensions are expected to follow.

So that nobody has to set this up by hand, there is the file .editorconfig. It defines indentation, line endings and character set per file type. Many editors apply these rules automatically.

root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2

[*.php]
indent_size = 4
Code example. All files use UTF-8, Unix-style line endings and indentation with 2 spaces. PHP files use 4 spaces.

Key points

  • HTML provides the structure: a doctype, one head with the title, one body with the content, semantic areas, headings from h1, alt texts and label with for.
  • In CSS, importance decides first, then specificity, then order. An ID beats a class, and a class beats an element.
  • padding is the inner spacing, margin the outer spacing.
  • JavaScript runs in the browser. Errors show up in the browser console, and defer runs a script only after the document.
  • PHP configuration files return an array with return. A parse error in additional.php takes down the whole website.
  • Global Fluid namespaces belong in the file Configuration/Fluid/Namespaces.php since TYPO3 14.1.
  • In YAML, indentation is structure: spaces instead of tabs, lists with a hyphen, comments with a hash.
  • In CSV, quotes inside a value are doubled. On import, the separator and the encoding matter.
  • Third-party photos need rights, external resources pass on the IP address, and AI texts are checked before publishing.
  • TypoScript ends in typoscript and TSconfig in tsconfig. Both are indented with 2 spaces, PHP follows PSR-12, and the .editorconfig belongs in the repository.

Terms

HTML
Markup language that describes the structure and content of a web page.
Semantic element
HTML element that states the meaning of an area, such as nav, main or footer.
Specificity
Weight of a CSS selector that decides which rule applies.
Box model
Structure of an element made of content, padding, border and margin.
defer
Attribute that makes a script run only after the document has been parsed.
Associative array
PHP array whose values are stored under keys instead of numbers.
Parse error
Syntax error that stops PHP from running a file at all.
Namespace
Name space that gives PHP classes unique names.
YAML
Configuration format whose structure comes from indentation and colons.
Enclosure character
Character, usually a double quote, that wraps a CSV value.
Personal data
Information that can be attributed to a specific person.
CC BY
Creative Commons licence that allows use when author and licence are named.
XLIFF
XML format for language files in TYPO3 extensions.
EditorConfig
File that gives editors uniform formatting rules per file type.

As of: November 15, 2026 (TYPO3 14.3 LTS)

Sources:

  • Learning objectives TYPO3 CMS Certified Integrator 14 LTS, course Web and PHP Basics (8 skills)
  • TYPO3 Explained 14.3, chapters Coding guidelines, YAML syntax, System configuration and Namespaces
  • TYPO3 changelog 14.1, Feature and Deprecation 108524 (global Fluid namespaces) and Important 107971 (XLIFF with 2 spaces)
  • Source code TYPO3 14.3 (typo3/cms-fluid, typo3/cms-backend, typo3/cms-core, typo3/cms-scheduler, typo3/cms-form), checked for Fluid namespaces, asset output, the CSV download in the Records module and cleanup tasks
  • RFC 4180 (CSV), YAML 1.2, W3C Selectors Level 4 (specificity), PSR-12, Creative Commons, GDPR
  • German Federal Office for Information Security (BSI), guide to artificial intelligence

This study guide was written with AI and checked against the sources.

Certifications & exams

Which exam comes next?

You can already practise for 51 exams, and 16 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications