8. TypoScript Flashcards
TypoScript of the TYPO3 cms
8.1.1 Which of the following objects are not TypoScript top level objects? (2)
- config
- TEXT
- styles
- GMENU
- PAGE
- includeLibs
Therefore, the correct answers are 2 and 4.
8.1.2 Which of these statements about TypoScript are true? (2)
- TypoScript is a programming language like ActionScript or JavaScript.
- TypoScript is an extension for TYPO3.
- TypoScript can be used to configure TYPO3.
- TypoScript mainly controls the output of the website in the frontend.
- Extensive knowledge of PHP is required to use TypoScript.
Therefore, the correct answers are 3 and 4.
8.1.3 You want to assign a multi-line value. Which of the following code sections are syntactically correct as replacements for the question marks? (1)
page = PAGE
page.10 = TEXT
???
- It is not possible to specify multi-line values in TypoScript; you can assign only single-line values.
- Answer
page.10.value (
Hello
World
) - Answer
page.10.value = (
HelloWorld
) - Answer
page.10.value = (Hello
World) - Answer
page.10.value (Hello
World
)
Therefore, the correct answer is 2.
8.1.4 It is possible to comment out lines in TypoScript. Which characters can be used as comment characters? (4)
- //
- /* … */
- #
- /
5.
Therefore, the correct answers are 1, 2, 3 and 4.
8.2.1 What do you enter in the constants area to make the following TypoScript setup code functional? (1)
config. language = {$langKey}
config. sys_language_uid = 1
config. htmlTag_langKey = {$langKey}
- $langKey = de
- {$langkey = en}
- langKey = jp
- langkey = cn
- LANGKEY = at
Therefore, the correct answer is 3.
8.2.2 What is the function of the following TypoScript code? (1)
page. meta.DESCRIPTION = {$meta.description}
page. meta.DESCRIPTION.override.field = description
- The value of field description is used.
- If the description field contains no value, the corresponding constant is used.
- The description field is always overwritten by the value of the corresponding constant.
- The value of the constant is used.
Therfore, the correct answer is 2.
8.2.3 The Fluid template of the page.10 object contains a variable {emailaddress}, which needs to be replaced by the value foo. How can you achieve this? (1)
- You enter the following code in the TypoScript constant area:
page. 10.templates.placeholder.emailaddress = TEXT
page. 10.templates.placeholder.emailaddress.value = foo - You enter the following code in the TypoScript setup area:
page. 10.templates.placeholder.emailaddress = TEXT
page. 10.templates.placeholder.emailaddress.value = foo - You enter the following code in the TypoScript setup area:
page. 10.templates.variables = EMAIL
page. 10.templates.variables.address = foo - You enter the following code in the TypoScript constant area:
page. 10.variables.emailaddress = TEXT
page. 10.variables.emailaddress.value = foo - You enter the following code in the TypoScript setup area:
page. 10.variables.emailaddress = TEXT
page. 10.variables.emailaddress.value = foo
Therefore, the correct answer is 5.
8.3.1 What is the output produced by the following TypoScript code? (1)
page = PAGE page.10 = COA page.10 { 30 = TEXT 30.value = A 30.wrap = B|C 40 = HTML 40.value = D 40.wrap = E|F 20 < .30 40.value = G }
- BACEGF
- DBACD
- DBACG
- EDFBACEGF
- DBACEGF
- DBACEDF
- BACBAC
Therefore, the correct answer is 7.
8.3.2 What is the output produced by this TypoScript code? (1)
page = PAGE page.10 = COA page.10 { 30 = TEXT 30.value = A 40 = TEXT 40.value = B 20 = TEXT 20.value = C 20.stdWrap.append < .30 10 = TEXT 10.prepend < .40 10.value = D }
- ABCD
- ABCD
- BDCAAB
- ABCADB
- BDCAB
- DBCAB
Therefore, the correct answer is 3.
8.3.3 What is the output produced by this TypoScript code? (1)
temp.text1 = TEXT
temp.text1.value = Certification
page = PAGE
page.10 =< temp.text1
temp.text1.wrap = TYPO3-|!
- Certification
- TYPO3-!
- TYPO3-Certification!
- There is no output.
- !
Therefore, the correct answer is 4.
8.3.4 What is the output produced by the following TypoScript code? (1)
object1 = TEXT object1.value = value1 page = PAGE page { 10 <= object1 15 < object1 15.value = - 20 < object1 } object1.value = value3
- value1
- -value1
- value1-value1
- value1-value3
- value3-value1
Therefore, the correct answer is 2.
8.3.5 What code do you enter in place of the question marks so that the output of the script is AB? (1)
lib.obj = COA
lib.obj {
10 = COA
10.10 = TEXT
10.10.value = A
10.20 < .10
}
page = PAGE
page.10 = COA
page.10 {
10 =< lib.obj
???
}
- 10.value = B
- 10.10.value = B
- 10.20.value = B
- 10.10.20.value = B
- 10.10.20.10.value = B
- 10.10.10.20.value = B
Therefore, the correct answer is 5.
8.4.1 A condition begins with square brackets. Which expression does it have to end in? (6)
- [GLOBAL]
- [global]
- [Global]
- [END]
- [end]
- [End]
- []
Therefore, the correct answers are 1, 2, 3, 4, 5 and 6.
8.4.2 In which areas can you use conditions? (4)
- TypoScript constants.
- TypoScript setup.
- Page TSconfig.
- User TSconfig.
- Fluid template.
Therefore, the correct answers are 1, 2, 3 and 4.
8.4.3 Is it possible to deactivate conditions in PageTSconfig and UserTSconfig? (1)
- No, conditions are part of the core, so they cannot be deactivated for TSconfig.
- Yes, by using the TypoScript instruction
config.TSconfigConditions = 0 - Yes, by using the PageTSconfig instruction
config.TSconfigConditions = 0 - Yes, by using the following key in the Install Tool:
[BE][TSconfigConditions] = 0 - Yes, by selecting the Use TSconfigConditions checkbox in the user settings
Therefore, the correct answer is 1.
8.4.4 Is it possible to check the backend_layout field in the backend, and if so, how? (1)
- No, that is not possible. Page properties are only relevant in the frontend and are checked there
by TypoScript. - [globalVar = TSFE:current|backend_layout = 1]
- [globalVar = TSFE:this|backend_layout = 1]
- [globalVar = TSFE:page|backend_layout = 1]
- [TSFE|backend_layout = 1]
- [this|backend_layout = 1]
- [page|backend_layout = 1]
- [current|backend_layout = 1]
Therefore, the correct answer is 7.
8.4.5 Which condition can you use to check whether a frontend user is logged in? (1)
- [login = true]
- [!login = false]
- [loginUser = *]
- [user = login]
- [loginUser = true]
- [login = *]
Therefore, the correct answers are 2 and 5.
8.4.6 Which conditions allow you to determine in the frontend, if the current user is also logged-in at the backend at the same time? (1)
- [globalVar = TSFE : beUserLogin > 0]
- [BEloginUser = *]
- [getTSFE()[‘beUserLogin’] == 1]
- [getTSFE().beUserLogin == 1]
- [TSFE:beUser > 0]
Therefore, the correct answers are 1 und 4.
8.4.7 Which condition can you use to check if the current time is 2pm or later? (1)
- [time >= 18]
- [time() > 18]
- [time(“18”)]
- [date(“G”) >= 18]
- [hour >= 18]
- [hour = > 18]
- [hour() > 18]
Therefore, the correct answer is 4.
8.4.8 Which conditions can you use to check if the user’s IP address is not 217.112.17.89? (1)
- [IP != 217.112.17.89]
- [not (getenv(“REMOTE_ADDR”) matches “/217.112.17.89/”)]
- [is(“REMOTE_ADDR”) != “217.112.17.89”]
- [getenv(“REMOTE_ADDR”) != “217.112.17.89”]
- [IP NOT 217.112.17.89]
- [IP = 217.112.17.89] [else]
- [IP == 217.112.17.89] [else]
Therefore, the correct answers are 2, 4 and 6.
8.4.9 Which of the following conditions have the correct syntax? (6)
- [language = *de][language = *en]
- [language = *de]or[language = *en]
- [language = *de]OR[language = *en]
- [language = *de]NOT[language = *en]
- [language = *de]||[language = *en]
- [language = *de]AnD[language = *en]
- [language = *de]&[language = *en]
- [language = *de]&&[language = *en]
Therefore, the correct answer are 1, 2, 3, 5, 6 and 8.
8.4.10 Which condition would you use to check whether the current day is Christmas Eve? (1)
- This is not possible; Christmas Eve falls on a different day of the week every year.
- This can only be achieved by implementing a custom condition.
- [dayofmonth = 24]AND[dayofweek = 12]
- [dayofmonth = 24]AND[month = 12]
- [day = 24]AND[month = 12]
Therefore, the correct answer is 4.
8.5.1 What does [20.h] stand for in the following TypoScript code? (1)
lib.getPageTitle = IMAGE
lib.getPageTitle.altText.field = title
lib.getPageTitle.file = GIFBUILDER
lib.getPageTitle.file {
XY = 400,[10.h]+[20.h]+20
10 = TEXT
10.text.field = title
10.text.listNum.splitChar = |
10.text.listNum = 0
10.fontSize = 20
10.fontColor = #cc0000
10.offset = 0,24
10.niceText = 1
20 < .10
20.text.listNum = 1
20.offset = 0,24+[10.h]+6
}
- A width of 20 pixels.
- A height of 20 pixels.
- The value of the constant called h.
- The height of the text field, which is defined in 20.
- An offset of 20 pixels in height.
- A font height of 20 pixels.
Therefore, the correct answer is 4.
8.5.2 Is it possible to select any font in images that contain text and are created using the GIFBUILDER? (2)
- Yes, but you have to select one of the 20 fonts supplied along with TYPO3.
- Yes, you can use a font from any font file with the TTF format (TrueType fonts).
- Yes, you can use a font from any font file with the OTF format (OpenType fonts).
- Yes, you can use a font from any font file with the CTF format (ClearType fonts).
- Yes, you can use a font from any font file with the PFM/PFB format (Type 1 fonts).
- No, you have to use an extension to do this.
- No, it is not possible.
Therefore, the correct answers are 2 and 3.
8.5.3 What does the c in the width and height specifications stand for in the following TypoScript code? (1)
page = PAGE
page. 10 = IMAGE
page. 10.file = testimage.jpg
page. 10.file.width = 100c+100
page. 10.file.height = 100c
- Calculated
- Crop
- Constant
- Clear
- Continuous
Therefore, the correct answer is 2.
8.6.1 Which TypoScript objects have to be addressed so that contents from tt_content can be returned? (2)
- PAGE
- TEMPLATE
- CONTENT
- CONFIG
- META
- TEXT
- USER
Therefore, the correct answers are 1 and 3.
8.6.2 This next code fills position 10 of a register with the value of the layout field of the current page. How can you return to querying this value at position 20 instead of the question marks? (2)
10 = LOAD_REGISTER 10.layout.cObject = TEXT 10.layout.cObject.data = TSFE:layout 20 = TEXT 20.???
- insertData = {register:layout}
- data = {register:layout}
- data = register:layout
- dataWrap = {register:layout}
- data = {$layout}
- data = {layout}
- data = layout
Therefore, the correct answers are 3 and 4.
8.6.3 Which content object needs to replace the question marks in the following code to display the current time on the website? (1)
page = PAGE page.10 = ??? page.10 { 10 = TEXT 10.data = date:U 10.strftime = %D - %H:%M:%S }
- USER
- USER_INT
- COA
- COA_INT
- TIME
- TEXT
- TEXT_INT
Therefore, the correct answer is 4.
8.6.4 You want to use TypoScript to specify a background image. Which content element needs to replace the question marks in the following code? (1)
page = PAGE page.10 = ??? page.10 { file = fileadmin/backgroundimg.jpg file.width = 100 file.height = 100 stdWrap.wrap = <div style="width:100px;height:100px;">Te\ xt</div> }
- IMG
- IMAGE
- IMG_RESOURCE
- IMAGE_RESOURCE
- GIFBUILDER
Therefore, the correct answer is 3.
8.6.5 You want the output of a TEXT content object to be multilingual. What do you need to do? (1)
page = PAGE
page. 10 = TEXT
page. 10.value = English Text
- You add the following: page.10._LOCAL_LANG.de = Deutscher Text.
- You add the following: page.10.lang.de = Deutscher Text.
- You add the following: page.10.de = Deutscher Text.
- Using the xml_ll extension is a convenient way of translating the language labels.
- Translations have to be created by means of conditions, for example: [globalVar = GP:L = 1]
Therefore, the correct answer is 2.
8.6.6 You want to display the content elements of a page in random order. Is this possible, and if so, how? (1)
page = PAGE page.10 = CONTENT page.10 { table = tt_content select { where = colPos = 0 max = 1 ??? } }
- That is not possible. Content elements are always displayed in the sequence specified in the backend.
- You have to use an special extension to do this.
- You replace the question marks with the following line:
orderBy = random - You replace the question marks with the following line:
orderBy = rand() - You replace the question marks with the following line:
orderBy = rand
Therefore, the correct answer is 4.