Pascal Bartl
Quiz by , created more than 1 year ago

TYPO3 CD 2020 (zweite Auflage) Quiz on 6.2 Built-in ViewHelpers, created by Pascal Bartl on 09/04/2021.

1
0
0
Pascal Bartl
Created by Pascal Bartl about 3 years ago
Close

6.2 Built-in ViewHelpers

Question 1 of 11

1

Which built-in ViewHelpers exist in the Fluid extension shipped with the TYPO3 core? (2)

Select one or more of the following:

  • 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)

Explanation

Question 2 of 11

1

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>

Select one or more of the following:

  • 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

Explanation

Question 3 of 11

1

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>

Select one or more of the following:

  • foobarbaz

  • foofoobarbarbaz

  • 0barbaz34

  • foobarbazfoobar

  • 01234

Explanation

Question 4 of 11

1

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>

Select one or more of the following:

  • A (g) BD (r) C (y)

  • g (A) r (BD) y (C)

  • A () BD () C ()

  • (Ag) (BDr) (Cy)

  • (gA) (rBD) (yC)

Explanation

Question 5 of 11

1

How can comments be implemented in Fluid so that the content does not appear in the HTML source code? (2)

Select one or more of the following:

  • <comment>content</comment>

  • {comment}content{/comment}

  • {content -> f:comment()}

  • <!-- content -->

  • <f:comment>content</f:comment>

Explanation

Question 6 of 11

1

How can an image be scaled down to a width of 100px by the TYPO3 core? (1)

Select one or more of the following:

  • <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" />

Explanation

Question 7 of 11

1

How can a string comparison be implemented with an If-ViewHelper? (2)
Assumption:
// assignment in the controller
$this->view->assign('string', 'Hello');

Select one or more of the following:

  • 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'}">

Explanation

Question 8 of 11

1

You want to add the HTML attribute data-user="fred" to the FormTextfield-ViewHelper. How can this be achieved? (2)

Select one or more of the following:

  • 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"

Explanation

Question 9 of 11

1

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.

Select one or more of the following:

  • <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="">

Explanation

Question 10 of 11

1

Which arguments are supported by the <f:flashMessage> ViewHelper? (1)

Select one or more of the following:

  • id, flash

  • id, name, title, each

  • id, class, title, queueIdentifier, as

  • renderMode, title, name

  • None of the arguments above

Explanation

Question 11 of 11

1

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)

Select one or more of the following:

  • 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

Explanation