How to hide content before === delimiter in article view?

I need to hide the summary content (everything before the === delimiter) when viewing a full article in Grav CMS. I only want to display the main content that comes after ===. What’s the correct way to implement this?

Thank you in advance for your help!

I read this: Displaying page content without summary
My blog-item.html.twig code is now:

<div class=“e-content”>
        {% set content = page.content|slice(page.summary|length) %}
        {{ content|raw }}
</div>

But still the blog articles are displayed together with the “summary”.

Does page.summary return anything? Sounds like you don’t have a summary :thinking:

Summary works well in Blog List.
Cache is cleared regularly :slightly_smiling_face:.

So what does page.summary|length say on the item page?

If you’re talking about what’s between the --- in the blog_item.en.md file, it looks like this:
summary: { }

That’s the summary config, but what’s the actual summary length?

Where exactly can I check the actual summary length? In which file or section should I look?
In /user/config/site.yaml it is written like this:

summary:
  enabled: true
  format: short
  size: 300
  delimiter: '==='

In blog-item.html.twig add:

{{ dump(page.summary) }}
{{ dump(page.summary|length) }}

Or is it {% ... %} :thinking:

Hi @Dima and @Karmalakas

I have just tested the recipe on my own installation and it works perfectly. Several things can happen here…

  • On the Blog page, where the entries are listed, a summary can be displayed even if it is not defined in your markdown file.
  • The code in blog-item.html.twig may be wrapped in a block that another file overwrites.
  • One other thing that escapes me :sweat_smile:

I would make sure you have created the summary in the .md file and review the templates that are involved in the view. Surely the error must be in there!

@Dima, what theme are you using?

Good question:) Gantry Helium. But the content is placed in “Page Content”.

Everything and it should work perfectly. But I’m trying to figure out what I’m doing wrong.

Yeah, that was right one :grin:
Next, where exactly did you make your code modification?