Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleAdd page template definition and script to use the block:
Code Block
languageyaml
titleblock-examples/templates/pages/block.yaml
renderType: freemarker
title: Block Page
templateScript: block-examples/templates/pages/block.ftl
Code Block
languageyaml
titleblock-examples/templates/pages/block.ftl
[#assign testContent = cmsfn.contentByPath("/test", "stories") /]
[#assign blocks = cmsfn.children(testContent, "mgnl:block") /]

<!DOCTYPE html>
<html xml:lang="en" lang="en" class="no-js">
    <head>
        [@cms.page /]
    </head>
    <body>
        ${content.title!""}
        ${content.lead!""}
        [#if testContent?hasContent]
            [#assign blocks = cmsfn.children(testContent, "mgnl:block") /]
            [#list blocks as block]
                [@cms.block content=block /]
            [/#list]
        [/#if]
    </body>
</html>

...