6.2 Built-in ViewHelpers

Description

TYPO3 CD 2020 (zweite Auflage) Quiz on 6.2 Built-in ViewHelpers, created by Pascal Bartl on 09/04/2021.
Pascal Bartl
Quiz by Pascal Bartl, updated more than 1 year ago
Pascal Bartl
Created by Pascal Bartl over 3 years ago
1
0

Resource summary

Question 1

Question
Which built-in ViewHelpers exist in the Fluid extension shipped with the TYPO3 core? (2)
Answer
  • The AntiCrossSiteScripting-ViewHelper (to protect the content against cross-site scripting attacks).
  • The Translate-ViewHelper (to retrieve a label from a language file)
  • The Average-ViewHelper (to calculate the average across values of an array)
  • The DebugViewHelper (to generate a HTML dump of the passed variable)
  • The Style-ViewHelper (to apply CSS styles to a string)
  • The ObfuscateEmail-ViewHelper (to obfuscate an email address)

Question 2

Question
What is the output of the following Fluid template? (1) <f:for each="{0: 'A', 1: 'B', 2: 'C', 3: 'D'}" as="v" iteration="i"> <f:if condition="{i.isEven}"> {i.cycle} </f:if> {v} </f:for>
Answer
  • A 2 B C 4 D
  • A 1 B C 3 D
  • 1 A B 3 C D
  • 2 A B 4 C D
  • A C

Question 3

Question
What is the output of the following Fluid template? (1) <f:for each="{0:1, 1:2, 2:3, 3:4, 4:5}" as="foo"> <f:cycle values="{0: 'foo', 1: 'bar', 2: 'baz'}" as="cycle"> {cycle} </f:cycle> </f:for>
Answer
  • foobarbaz
  • foofoobarbarbaz
  • 0barbaz34
  • foobarbazfoobar
  • 01234

Question 4

Question
What is the output of the following Fluid template? (1) <f:groupedFor each="{0: {name: 'A', tag: 'g'}, 1: {name: 'B', tag: 'r'}, 2: {name: '\ C', tag: 'y'}, 3: {name: 'D', tag: 'r'}}" as="foo" groupBy="tag" groupKey="tag"> {tag} (<f:for each="{foo}" as="bar" key="label">{bar.name}</f:for>) </f:groupedFor>
Answer
  • A (g) BD (r) C (y)
  • g (A) r (BD) y (C)
  • A () BD () C ()
  • (Ag) (BDr) (Cy)
  • (gA) (rBD) (yC)

Question 5

Question
How can comments be implemented in Fluid so that the content does not appear in the HTML source code? (2)
Answer
  • <comment>content</comment>
  • {comment}content{/comment}
  • {content -> f:comment()}
  • <!-- content -->
  • <f:comment>content</f:comment>

Question 6

Question
How can an image be scaled down to a width of 100px by the TYPO3 core? (1)
Answer
  • <img src="image.jpg" width="100">
  • <img src="image.jpg" width="100px">
  • <f:img src="image.jpg" width="100" />
  • <f:image src="image.jpg" width="100" />
  • <f:size src="image.jpg" width="100" />

Question 7

Question
How can a string comparison be implemented with an If-ViewHelper? (2) Assumption: // assignment in the controller $this->view->assign('string', 'Hello');
Answer
  • This is not possible.
  • <f:if condition="{string}=='Hello'">
  • <f:if condition="{string}='Hello'">
  • <f:if condition="{string}==Hello">
  • <f:if condition="{42:string}=={42:'Hello'}">

Question 8

Question
You want to add the HTML attribute data-user="fred" to the FormTextfield-ViewHelper. How can this be achieved? (2)
Answer
  • By adding the attribute additionalAttributes="{data-user: 'fred'}"
  • By adding the attribute addAttributes="{data-user: fred}"
  • By adding the attribute data="{user: 'fred'}"
  • By adding the attribute data-user="fred"

Question 9

Question
What is the HTML output of the following FormTextfield-ViewHelper? (1) <f:form.textfield property="title" /> Assumptions: • The attribute “object” of the parent Form-ViewHelper reads {blog}. • The extension key reads my_extension. • The plugin name reads Bloglisting.
Answer
  • <input type="text" name="tx_MyExtension_Bloglisting[blog][title]" value="">
  • <input type="text" name="tx_myextension_bloglisting[blog][title]" value="">
  • <input type="text" name="blog[title]" value="">
  • <input type="text" name="title" value="">
  • <input type="text" name="[blog][title]" value="">

Question 10

Question
Which arguments are supported by the <f:flashMessage> ViewHelper? (1)
Answer
  • id, flash
  • id, name, title, each
  • id, class, title, queueIdentifier, as
  • renderMode, title, name
  • None of the arguments above

Question 11

Question
What is required to make sure that all GET parameters passed in the request are added to the link generated by the Link-ViewHelper? (2)
Answer
  • This is the default behaviour - nothing special needs to be done
  • The attribute addQueryStringMethod must be set
  • The attribute addQueryString must be set
  • The attribute addQuery must be set
  • The attribute additionalParams must be set
Show full summary Hide full summary

Similar

Diffusion and osmosis
eimearkelly3
Concepts in Biology Final Exam
mlszala
CHEMISTRY C1 3
x_clairey_x
Geography Coastal Zones Flashcards
Zakiya Tabassum
Prueba de Aptitud Académica - Lenguaje
Teresa Nadal
Biology- Genes, Chromosomes and DNA
Laura Perry
FCE Practice Fill In The Blank
Christine Sang
GCSE Science - B1 - You and Your Genes - Genes, Chromosomes and DNA
GeorgeHaines
Carbohydrates
Julia Romanów
2PR101 1.test - 7. část
Nikola Truong
Legislative Branch
Mr. Vakhovsky