What is TypoScript
People are so confused and unhappy with TYPO3 also because it added a new “script language” that usually people do not like to deal with.
So what’s TypoScript (TS) and why it has been used? Is it as complex as people things?
By TYPO3 Documentation it has been defined as follows:
“TypoScript is a syntax for defining information in a hierarchical structure using simple ASCII text content.”
This means that: TypoScript itself does not “do” anything – it just contains information.
TypoScript is only transformed into function when it is passed to a program which is designed to act according to the information in a TypoScript information structure.
So strictly speaking TypoScript has no function in itself, only when used in a certain context.
Since the context is almost always to configure something you can often understand TypoScript as parameters (or function arguments) passed to a function which acts accordingly (e.g. “background_color = red”).
And on the contrary you will probably never see TypoScript used to store information like a database of addresses – you would use XML or SQL for that.
REFERENCE:
https://docs.typo3.org/typo3cms/TyposcriptSyntaxReference/AppendixA/
Index.html#appendix-a-what-is-typoscript
“Hello World” with TypoScript
In every programming language you start to learn there would be a first sentence that you have to output to learn how the environment works.
Same think we are going to do here by displaying a “Hello World” statement with TypoScript.
Creating a TypoScript Hello World statement is pretty simple just adding some lines of code on TS config configuration.
If you are asking yourself where the typoscript code is located in the backend system ,I think this tutorial would be pretty helpfull. After watching that you can now start adding you code to the TS Setup field.
page = PAGE page.10 = TEXT page.10.value = Hello World
Description
At the first line we are creating a new object of the configuration object called PAGE (the object should always be written on capitals since typoscript is case sensitive).
After we have created the new object now we can create a new object at the possition 10 of the template. and then assing to that the value to “Hello World”.
The positions are just parts of the main template where your code should be apeared.