Reputation: 306
Trying to learn TYPO3 I have setup a new (Version 8.7.6) installation. I have gone on fine so far but when I try to set a template for my first and only page with Typoscript then for this page I get the error message in the frontend "Uncaught TYPO3 Exception #1294587217: The page is not configured! [type=0][page]. This means that there is no TypoScript object of type PAGE with typeNum=0 configured".
Edit - solution:
Along with the answer of NextThursday I found out the two flaws in my typoscript. So basically it has nothing to do with any of the details named below.
As stated in the answer page.typeNum = 0
has to be added below page = PAGE
, which seems to be a "new" concept, at least is was not part of the solutions I consulted as my reference.
The opening bracket "{" of my further page definition is not allowed to be in the following row but must be in the same row making the two rows page
and {
to a single row page {
Details:
Typoscript:
#Force cache refresh
config.cache_period = 2
# Default PAGE object:
/*
page = PAGE
page.10 = TEXT
page.10.value = HELLO WARLD!
*/
# My new PAGE object
page = PAGE
page
{
bodyTag = <body>
10 = TEMPLATE
10.template = FILE
10.template.file = fileadmin/templates/blog/small.html
10.workOnSubpart = BODYSTART
}
The template file small.html resides in folder DOCUMENT_ROOT\mytypo3\fileadmin\templates\blog:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<!-- ###BODYSTART### begin -->
<!-- ###BODYSTART### end -->
</body>
</html>
I would be happy for an explanaition what is wrong with the above code and how to correctly set a template for a page under the given ("Details") conditions.
Upvotes: 0
Views: 324
Reputation: 7939
As written in the comment, the correct answer is that the bracets must be on the same line. The correct code is
page = PAGE
page {
bodyTag = <body>
10 = TEMPLATE
10.template = FILE
10.template.file = fileadmin/templates/blog/small.html
10.workOnSubpart = BODYSTART
}
The typeNum is set to 0, see docs at https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Page/Index.html#typenum
This determines the typeId of the page. The &type= parameter in the URL determines, which page object will be rendered. The value defaults to 0 for the first found PAGE object, but it must be set and be unique as soon as you use more than one such object (watch this if you use frames on your page)
!
Upvotes: 1
Reputation: 2432
As the error says, your TypoScript is missing the typeNum:
page.typeNum = 0
Upvotes: 0