Versions Compared

Key

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

...

Expand
titleDecorate the Stories app to allow it to use our new block type:
Code Block
languageyaml
titleblock-examples/decorations/stories-app/apps/stories.yaml
subApps:
  editor:
    contentDefinition:

      blocks:
        - text
        - image
        - video
        - externalLink
        - quote
Expand
titleAdd a story:

Image Added

Add a title and lead text:

Image Added

Add a new quote block:

Image Added

Add the url:

Image Added

Add the quote:

Image Added

Click Save and Publish

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>
        [#if testContent?hasContent]
        [#assign blocks = cmsfn.children(testContent, "mgnl:block") /]
        [#list blocks as block]
            [@cms.block content=block /]
        [/#list]
        [/#if]
    </body>
</html>

...