1. Subject: Templating - Template Script
    Which of the following statements is correct?
    A - A template script defines the output, typically HTML and is interpreted by a Renderer.
    B - A template script is a Java class library that understands a particular templating language and produces text output.
    C - A template script is a set of code, typically Freemarker that generates Java methods.
    Correct answer: A

  2. Subject: Templating - Template Script
    [@cms.page /] is the FreeMarker directive to initialize a page. Where is the right place to initialize a page?

    A - Within the HTML <head> tag.
    B - Within the HTML <body> tag.
    C - Just before the rendering of the first area.
    D - A Magnolia page doesn't need to be initialized.
    Correct answer: A


  3. Subject: Templating - Template Script
    The highlighted area in the image below shows a result of:

    A - An uninitialized page.
    B - Having no action defined in the template definition.
    C - A template without a dialog.
    D - Previewing the page.
    Correct answer: A

                   
  4. Subject: Templating - Template Script
    Which Magnolia FreeMarker directive triggers the rendering of an area?
    A - [@cms.area name="areaName"/]
    B - [@cms.component name="areaName" /]
    C - [@cms.render name="areaName" /]
    Correct answer: A

  5.  Subject: Templating - Template Script
    Which Magnolia FreeMarker directive is needed in every page script to ensure that the page editor works?
    A - [@cms.page /]
    B - [@cms.component content=componentNode /]
    C - [@cms.area name="areaName"/]
    D - [@cms.editor name="pageEditor"/]
    Correct answer: A

  6. Subject: Templating - Template Script
    Which Magnolia FreeMarker directive triggers the rendering of a component?
    A - [@cms.component content=componentNode /]
    B - [@cms.area name="componentName"/]
    C - [@cms.render name="componentName" /]
    D - [@cms.component name="componentName" /]
    Correct answer: A

  7. Subject: Templating - Template Script
    You would like that a page renders a page title.
    In the page script, how can you access a 'title' property in the current rendered page? 
    A - ${content.title}
    B - ${model.title}
    C - ${def.title}
    D - ${page.title}
    Correct answer: A

  8. Subject: Templating - Template Script
    Magnolia provides various objects to every template script.
    Which of the following objects reflects the current rendered node?
    A - ${content}
    B - ${model}
    C - ${def}
    Correct answer: A

  9. Subject: Templating - Template Script
    As a templater, you will need to achieve various tasks in your scripts to operate on JCR nodes.
    Two examples of such tasks would be retrieving all child nodes of a page node and creating a link to a page node.
    For achieving such templater tasks, Magnolia provides a set of templating utility classes in template scripts.
    How do we call Magnolia's set of templating utility classes?
    A - Templating Functions
    B - Templating Models
    C - Templating Renderers
    Correct answer: A

  10. Subject: Templating - Template Script
    In Magnolia, how do you access a property of the current rendered content?
    A - ${content.propertyName}
    B - ${cmsfn.propertyName}
    C - ${propertyName}
    D - ${component.propertyName}
    Correct answer: A

  11. Subject: Templating - Template Script
    You have accessed and rendered the page-header's abstract, however they seem to display the <p> tags:

    How will you solve this?
    A - Decode abstract property using the cmsfn templating function: ${cmsfn.decode(content).abstract}.
    B - Encode abstract property: ${cmsfn.encode(abstract)}.
    C - Access property through ${content.abstract} and remove the <p> tags from the template script.
    D - Add more content to the rich text field, <p> tags showing means the text that has been entered is too short.
    Correct answer: A

  12. Subject: Templating - Template Script
    In templating, it is very important to null proof your code to avoid null pointer exceptions.
    What are the two most commonly used FreeMarker null checking possibilities that will help you null proof your code?
    A - "!" character and "?has_content"
    B - if and else statements
    C - "!=" and "=="
    D - Using macros and functions
    Correct answer: A

  13. Subject: Templating - Template Script
    You have rendered an area in your template script. However, as you checked your page, the order of their appearance isn't what you expected.
    What could be the rule that you missed?
    A - For more than one area, they must be ordered according to how they will be rendered in a page.
    B - The main area must always be rendered first as it holds more components than other areas.
    C - Since footer area will be inherited, it is important to define it first to be rendered first as well.
    D - The directive that references the area must be placed within the <div> where the area is expected.
    Correct answer: A

  14. Subject: Templating - Template Script
    Go through the code below. What do they mean?

    [#if content.header?has_content] <h1>${content.header}</h1> [/#if]

    A - Header content will only be rendered if value exists.
    B - It will display an empty string when there is no content found.
    C - It is simply null checking.
    Correct answer: A

  15. Subject: Templating - Template Script
    What templating function helps you in your task to get assets and create links to assets?
    A - damfn
    B - cmsfn
    C - resfn
    D - jsonfn
    Correct answer: A

  16. Subject: Templating - Template Script
    Using the correct templating function, how will you resolve the page's 'imageLink' property to the asset node.
    A - [#assign asset = damfn.getAsset(content.imageLink)]
    B - [#assign asset = cmsfn.getAsset(content.imageLink)]
    C - [#assign asset = "style='background-image: url($damfn.{content.imageLink});'"]
    D - [#assign asset = "style='background-image: url($cmsfn.{content.imageLink});'"]
    Correct answer: A

  17. Subject: Templating - Template Script
    What templating function helps you in your task to get content and create links?
    A - cmsfn
    B - damfn
    C - resfn
    D - jsonfn
    Correct answer: A

  

  • No labels