Can I store modular content in something other than the page content?

Is there anyway to store modular content is something other than ‘content’ in the yaml file? I want to fill a sidebar with modular content, but from the docs it becomes part of the page content and then gets rendered with the content.

---
title: 'Here''s the latest news'
menu: Read
process:
    markdown: true
    twig: true
content:
    items: '@self.modular'
    order:
        by: default
        dir: asc
        custom:
            - find-specific
            - popular-posts
---

{% include 'partials/most-recent-posts.html.twig' %}

This gets rendered with {{ page.content }} in my template which is undesirable. What’s the best way to store and render modular content separate from the page content? Thanks.

@skipper, It seems I often get confused lately… And unfortunately, I’m also getting confused by this question.

Please help the community help you by creating clear and succinct questions.

Is there anyway to store modular content is something other than ‘content’ in the yaml file?

  • What is: modular content?
    The markdown (= content) of a modular page (modular.md), or the end-result of a Twig template that combines the content (markdown) of several modules into a single HTML page?
  • What do you mean by: is something other than ‘content’ in the yaml file
    • What is “‘content’”
    • Which yaml file? Or do you perhaps mean the frontmatter/header (which contains yaml) of the page?

but from the docs it becomes part of the page content and then gets rendered with the content.

Please clarify…

This gets rendered with {{ page.content }} in my template which is undesirable. What’s the best way to store and render modular content separate from the page content?

Please clarify…

In your snippet you are trying to include the result of a Twig template into the Markdown (content) of a modular page.

  • Why?
  • Shouldn’t the Twig file for that modular page be changed?
    Or maybe create a new module for the modular, with its own Twig template that lists the "most-recent-posts?
  • What are you trying to achieve?

Please consider updating your initial post instead of creating a new reply.

Thanks for steering me, and sorry for the confusing question. I think I figured it out. I think my problem was that page.find(’/read’).children was rendering pages AND modular pages. Doing a check for {% if not firstPost.modular() %} is weeding out the non-modular pages.