Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

[TASK] Make TypoScript documentation clearer and more consistent #86

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions Documentation/Introduction/Index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: /Includes.rst.txt
.. include:: /Includes.rst.txt

linawolf marked this conversation as resolved.
Show resolved Hide resolved

.. _introduction:
Expand Down Expand Up @@ -26,7 +26,7 @@ community in the retired TYPO3 Wiki and then translated and corrected by
more community members. Big thanks go the TYPO3 CMS community members for their
initial efforts.

Since then it is maintained by the Documentation Team.
Since then it is maintained by the `Documentation Team <https://typo3.org/community/teams/documentation>`__.


.. _feedback:
Expand All @@ -39,12 +39,12 @@ For general questions about the documentation get in touch by writing to

If you find a bug in this manual, please be so kind as to check the online
version on https://docs.typo3.org/typo3cms/TyposcriptIn45MinutesTutorial/. From
there you can hit the "Edit me on GitHub" button in the top right corner and
there you can hit the "Edit on GitHub" button in the top right corner and
submit a pull request via GitHub. Alternatively you can just file an issue
using the bug tracker:
https://github.com/TYPO3-Documentation/TYPO3CMS-Tutorial-Typoscript45Minutes/issues.

Maintaining high quality documentation requires time and effort and the TYPO3
Documentation Team would appreciate any support you can offer. If you would like
to help out, contact us in the `TYPO3 Documentation Slack channel <https://typo3.org/community/teams/documentation>`__ to find out more.

to help out, contact us in the `TYPO3 Documentation Slack channel <https://typo3.slack.com/archives/C028JEPJL>`__
to find out more.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ called `tt_content` therefore the default `renderObj` is also called

The basic extension for rendering content in TYPO3 since TYPO3 v8 is
`fluid_styled_content`. The example shows how
`fluid_styled_content` is setup: It defines a basic content element based
`fluid_styled_content` is set up: It defines a basic content element based
on the content object `FLUIDTEMPLATE` which is able to render html
templates using the `fluid` templating engine. For every content element,
the basic template, layout and partial parts are defined. As you can see by
Expand Down Expand Up @@ -101,6 +101,7 @@ take a look at how the text element is rendered:
.. code-block:: html

# Taken from typo3/sysext/fluid_styled_content/Resources/Private/Templates/Text.html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="Main">
<f:format.html>{data.bodytext}</f:format.html>
Expand Down
5 changes: 2 additions & 3 deletions Documentation/TypoScriptFunctions/Typolink/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ typolink
that allows us to generate all kinds of links.
If possible one should always use this function to generate links
as they will be processed by TYPO3 CMS. This is a prerequisite,
for example, for the "realurl" extension to generate speaking URLs
or for the anti-spam protection of email addresses.
for example, for the anti-spam protection of email addresses.

Please resist the urge to a straight `<a href="...">...</a>` construct
in your templates.
Expand Down Expand Up @@ -45,7 +44,7 @@ The example above will generate this HTML code:

.. code-block:: html

<a class="linkclass" target="\_blank" href="http://www.example.com/">Example link</a>
<a href="http://www.example.com/" target="_blank" class="linkclass" rel="noreferrer">Example link</a>

`typolink`, in a way, almost works like a wrap: the content which is
defined for example by the `value` property, will be wrapped by the HTML anchor tag.
Expand Down
18 changes: 9 additions & 9 deletions Documentation/TypoScriptObjects/RenderingContent/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Objects rendering content
stdWrap.typolink.parameter = 1
}

The result is an image based on file :file:`logo.gif` with width of 200
pixels and a link to the page 1.
The result is an image based on file :file:`logo.gif` with width of 200 pixels
and a link to the page 1.

- :ref:`TEXT <t3tsref:cobj-text>` is for the rendering of standard text or the
content of fields::

lib.motto = TEXT
lib.motto.value = Inspiring people to share
lib.motto.wrap = <div class="highlight">|</div>
lib.slogan = TEXT
lib.slogan.value = Inspiring people to share
lib.slogan.wrap = <div class="highlight">|</div>

- :ref:`FILES <t3tsref:cobj-files>` is used to retrieve information about one
or more files and perform some rendering with it::
Expand All @@ -45,10 +45,10 @@ Objects rendering content
}
}

This code will probably look pretty abstract to you right now. What it does
is to reference the images that were related to a given page in the "media"
field. It takes each of these images and resizes them to a maximum width of
500 pixels. Each image is wrapped in a `<div>` tag.
This code will probably look pretty abstract to you right now. What it does
is to reference the images that were related to a given page in the "media"
field. It takes each of these images and resizes them to a maximum width of
500 pixels. Each image is wrapped in a `<div>` tag.

- :ref:`FLUIDTEMPLATE <t3tsref:cobj-fluidtemplate>` renders a template with the
template engine Fluid with variables and data that you define - as previously
Expand Down
6 changes: 1 addition & 5 deletions Documentation/TypoScriptOverview/FirstSteps/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,13 @@ To make things clearer, TypoScript code can be structured using curly braces

mypage = PAGE
mypage {

typeNum = 0

10 = TEXT
10 {

value = Hello world
stdWrap {
typolink {

parameter = http://www.typo3.org/
additionalParams = &parameter=value

Expand All @@ -185,10 +182,9 @@ To make things clearer, TypoScript code can be structured using curly braces

postCObject = TEXT
postCObject {

value = This text also appears in the link text
stdWrap.wrap (
|, because the postCObject is executed before the typolink function.
|, because the postCObject is executed before the typolink function.
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Documentation/TypoScriptOverview/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TypoScript - A quick overview
This introduction is designed to give you a
comprehensive understanding of how TypoScript works.
In other words the goal is not to just help you make it work,
but to make sure that you end up knowing why and how
but to make sure that you end up knowing **why** and **how**
it works.

At the end of this tutorial, you will not have a complete
Expand Down
17 changes: 8 additions & 9 deletions Documentation/TypoScriptOverview/Prerequisites/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ familiar with the concepts of pages and content elements.

A few more elements that you need to know before starting:

- all content elements are stored in a database table called `tt_content`

- each content element has a database field called `CType` in which
* all content elements are stored in a database table called `tt_content`
* each content element has a database field called `CType` in which
the type of the content element is stored

- the `tt_content` table also has a field called `pid` which refers
* the `tt_content` table also has a field called `pid` which refers
to the page the content element is on

- in general, each TYPO3 CMS table has a field called `uid` which
* in general, each TYPO3 CMS table has a field called `uid` which
contains the primary key (unique id for each record)

- you will probably find useful to have a database access to check
* you will probably find it useful to have a database access to check
how information is stored as we proceed along this tutorial

.. note::
`pid` stands for *parent*-id, not *page*-id.
20 changes: 14 additions & 6 deletions Documentation/TypoScriptOverview/TheTermTemplate/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ The term template has a double meaning in TYPO3 CMS. On the one hand,
there is the *HTML template file*, which serves as the skeletal
structure in which the content, provided by the CMS,
will be rendered. On the other hand, there is the *TypoScript template*,
which is created in the template module in the TYPO3 CMS
which is created in the Template/TypoScript module in the TYPO3 CMS
linawolf marked this conversation as resolved.
Show resolved Hide resolved
Backend and can exist on any page.

.. versionchanged:: 12.3
The Template module moved to another section and changed its name to
"TypoScript" in TYPO3 version 12.

.. image:: /Images/ManualScreenshots/ModuleNameTypoScript.png
:alt: Module name "TypoScript"
:class: with-shadow

The :doc:`Sitepackage Tutorial <t3sitepackage:Index>` shows how the two are related
together. This manual is purely about TypoScript templates.

Expand All @@ -35,16 +43,16 @@ detailed information:
.. figure:: /Images/ManualScreenshots/NoTypoScriptTemplateFound.png
:alt: Error message "No TypoScript template found!"

"No TypoScript template found": This warning appears if no template,
with the root level flag enabled, is found in the page tree.
`No TypoScript template found`: This warning appears if no template,
with the `root level` flag enabled, is found in the page tree.

.. figure:: /Images/ManualScreenshots/ThePageIsNotConfigured.png
:alt: Error message "The page is not configured!"


"The page is not configured! [type=0][]. This means that there is no TypoScript
object of type PAGE with typeNum=0 configured.": This warning appears if the
rootlevel flag of a template in the page tree is enabled (i.e. this template
`The page is not configured! [type=0][]. This means that there is no TypoScript
object of type PAGE with typeNum=0 configured.`: This warning appears if the
root level flag of a template in the page tree is enabled (i.e. this template
is used), but no :ref:`PAGE <t3tsref:page>` Object can be found.

The following TypoScript setup code is enough to remove this warning::
Expand Down
9 changes: 4 additions & 5 deletions Documentation/TypoScriptOverview/WhyTypoScript/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ for display and then renders it in the frontend.
To render a website, we only need to define what content to display and
how it will be rendered.

- The "what" is controlled by the backend - where pages and content
* The "what" is controlled by the backend - where pages and content
are generated.
* The "how" is controlled by TypoScript.

- The "how" is controlled by TypoScript.

With TypoScript, we define how the individual content elements are
rendered in the frontend. For example, we use TypoScript to add a
With TypoScript, we can define how the individual content elements are
rendered in the frontend. For example, we can use TypoScript to add a
:html:`<div>` tag to an element, or the :html:`<h1>` tag to a headline.
5 changes: 5 additions & 0 deletions Documentation/UsingFluidStyledContent/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ as there is much to learn by example. To view the raw code, place yourself on
the root page of your website and move to the **WEB > Template** module. Then
linawolf marked this conversation as resolved.
Show resolved Hide resolved
choose the *Template Analyzer* function.

.. versionchanged:: 12.3
The Template module moved to another section and changed its name to
"TypoScript" in TYPO3 version 12.

You should see a list of all used TypoScript templates and how they possibly
include one another. All templates are evaluated by TYPO3 CMS from top to
bottom.

.. include:: /Images/AutomaticScreenshots/TemplateAnalyzerStructure.rst.txt


With a click on "EXT:fluid\_styled\_content/static/", you can view the content
of that template (below the hierarchical view), first the constants, then the
setup (scroll down).
Expand Down
6 changes: 4 additions & 2 deletions Documentation/UsingStdWrap/CObject/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ used to replace the content with a TypoScript object. This can be a
example::

10.typolink.title.cObject = TEXT
10.typolink.title.cObject.value = Copyright
10.typolink.title.cObject.case = upper
10.typolink.title.cObject {
value = Copyright
case = upper
}

8 changes: 5 additions & 3 deletions Documentation/UsingStdWrap/HeedTheOrder/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ have set them in your TypoScript template.
Let's consider this example::

10 = TEXT
10.value = typo3
10.noTrimWrap = |<strong>Tool: |</strong>|
10.case = upper
10 {
value = typo3
noTrimWrap = |<strong>Tool: |</strong>|
case = upper
}

It results in the following:

Expand Down
Loading