蜜豆视频

Author a block

After pushing the teaser block鈥檚 JSON to the teaser branch, the block becomes editable in the AEM Universal Editor.

Authoring a block in development is important for several reasons:

  1. It verifies that the block鈥檚 definition and model are accurate.
  2. It allows developers to review the block鈥檚 semantic HTML, which serves as the foundation for development.
  3. It enables deployment of both the content and semantic HTML to the preview environment, supporting faster block development.

Open Universal Editor using code from the teaser branch

  1. Log in to AEM Author.

  2. Navigate to Sites and select the site (WKND (Universal Editor)) created in the previous chapter.

    AEM Sites

  3. Create or edit a page to add the new block, ensuring the context is available to support local development. While pages can be created anywhere within the site, it鈥檚 often best to create discrete pages for each new body of work. Create a new 鈥渇older鈥 page named Branches. Each sub-page is used to support the development of the same-named Git branch.

    AEM Sites - Create Branches page

  4. Under the Branches page, create a new page titled Teaser, matching the development branch name, and click Open to edit the page.

    AEM Sites - Create Teaser page

  5. Update the Universal Editor to load the code from the teaser branch by adding ?ref=teaser to the URL. Make sure to add the query parameter BEFORE the # symbol.

    Universal Editor - Select teaser branch

  6. Select the first section under Main, click the add button, and choose the Teaser block.

    Universal Editor - Add Block

  7. On the canvas, select the newly added teaser and author the fields on the right, or via the inline editing capability.

    Universal Editor - Author Block

  8. After completing authoring, select the Publish button in the top right of Universal Editor, choose publish to Preview, and publish the changes to the preview environment. The changes are then published to the aem.page domain for the website.
    AEM Sites - Publish or Preview

  9. Wait for the changes to publish to preview, then open the webpage via the AEM CLI at .

    Local Site - Refresh

Now, the authored teaser block鈥檚 content and semantic HTML are available on the preview website, ready for development using the AEM CLI in the local development environment.

recommendation-more-help
bb44cebf-d964-4e3c-b64e-ce882243fe4d