Clarification of term TypoScript

What do we mean, when we use the word “TypoScript”?

  1. Everything, including TypoScript Templates (including constants and setup), the TypoScript syntax and TSconfig?
  2. TypoScript templates (as used in the Template Module and in .typoscript files in extensions)
  3. TypoScript syntax (as used in TSconfig and TypoScript templates setup and constants)

Also,

  • Is TSconfig (a special kind of) TypoScript? (After all, the word TSconfig was probably derived from TypoScript config).

Motivation

Main motiviation of having clear, unambiguous terms in the context of TypoScript and using them throughout the core and the documentation.

Writing good documentation means writing easy to understand, clear documentation. Using fuzzy terms (the same term with different meaning, depending on context) makes this more difficult.

I would prefer terms that always have the same meaning and not 1 term for several meanings for more clarity.

Examples

TypoScript influences many aspects of a TYPO3 site:
TypoScript can be used in the TSconfig field of a backend user or a backend user group or in the TSconfig field of a page. It will then change the look and behavior of forms in the backend .
The frontend rendering in contrast is defined by the TypoScript used in TypoScript templates. This document covers only frontend rendering."

– TypoScript in 45 minutes

Here, the word TypoScript actually means “TypoScript syntax” in part of the sentences and “TypoScript templates” in another. I think this might be confusing for beginners especially because TSconfig is not TypoScript (or at least TSConfig is not TypoScript Templates), but the TypoScript syntax is used there as well.

I think, if the TypoScript syntax were not used outside of TypoScript templates, e.g. in TSconfig and TypoScript constant syntax were not used in Extension configuration as well it would not be such a problem in the first place.

It’s like having another language that is not PHP but uses the same syntax as PHP (but a different set of functions) and then you call it PhPLang and than you have another weird syntax for header files with the comment defining the datatype.

Often, information about TypoScript covers both (syntax and templates).

Proposal

Try to avoid the term TypoScript (without additional modifiers) entirely. Try to always use one of the following terms:

  • TypoScript syntax: If used to describe the TypoScript syntax used in TypoScript templates and TSconfig
  • TypoScript Template(s): For everything covering TypoScript Templates as used in the Template module, Configuration/TypoScript files, .typoscript files, TypoScript object browser etc.

In order to differentiate between constants and setup in TypoScript templates:

  • TypoScript constants
  • TypoScript setup

In order to differentiate between syntax for constants and other:

  • TypoScript syntax” (generally implies “TypoScript syntax for TypoScript setup” or TSconfig as opposed to constants), but “TypoScript setup syntax” can be used to stress this
  • "TypoScript constant syntax": syntax used for TypoScript constants and Extension configuration

You could argue, that TypoScript comment syntax and TypoScript syntax are the same. Well, mostly they are. But no.

Impact

  • Rename TypoScript reference to "TypoScript Template Reference"
  • Rename TypoScript in 45 minutes to "TypoScript Templates in 45 Minutes"
  • (The chapter TypoScript Syntax in TYPO3 Explained can stay as is)

Related

Please note, that the term “Template” is also ambiguous as has been pointed out in “TYPO3 in 45 minutes”. Well, let’s just do the best we can to be as clear as possible …

1 Like

Without having read your lengthy post (due to time restrictions) I take the freedom to post my “definition”

TypoScript: Syntax of configuration
Template: Configuration for Frontend using TypoScript
TSconfig: Configuration for Backend using TypoScript

Moreover I opt for

  • Template Constansts
  • Template Setup
  • TSconfig

(the latter one has no constants)

I can confirm the problem, the new people are confused about the term “typescript”, as it used for templating, page and user config. In addition to the proposal of Sybille, I would rename

  • Page TSconfig to PageConfig
  • User TSconfig to UserConfig

They are both pure configuration and no functionalities like stdWrap…

2 Likes

Actually the documentation says it all. Yea olde “TypoScript Syntax and In-depth Study” was integrated in the Core documentation and this page clearly explains TypoScript, the contexts, the differences in features, and so on:
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/TypoScriptSyntax/Syntax/Contexts.html

I’d use TypoScript for the syntax or ‘language’.
The contexts are “TypoScript templates” and “TSconfig” (or more specific “User TSconfig” and “Page TSconfig”)
“TypoScript templates” are divided in “Constants” and “Setup”.

The syntax is the same for all (sub)contexts; it’s just that some constructs/features only work in certain (sub)contexts.

I think for most people TypoScript is a generic term similar to “Techno” (music) nowadays.

TypoScript itself is for me just everything what is in the template editor in the setup area. (so for the FE area)

The other one is UserTs and PageTs -> I don’t use the name TypoScript anymore.
This documentation already distinguishes between “.typoscript” and “.tsconfig” (files): https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/FilesAndLocations/Index.html

So I’d say:
TypoScript = syntax for everything

PageTs
UserTs
Constants
Templates / or TypoScript - because TypoScript works completely in these files (as the only one)


Furthermore, the spelling “TSconfig” is somehow wrong for me - this should rather be called TsConfig <- in my opinion… cause UpperCamelCase - TypoSript Config = TsConfig