How to show first paragraph?

Hi,

I’m trying to do a query just like mentioned in this topic:

However, I want to see the first paragraph of each found page.
Is there an easy way through queries or templates?

Something like

Seems, I’m not seeing the forest for the trees… :frowning:

Thanks a lot!

All paragraphs are indexed in the paragraph tag. What you can do is query that, filter by the page name, order by pos (the position in the page) and then limit to the first result.

This is how you can do that in a template:

{{#let @pageName = name}}
{{at({paragraph where page = @pageName order by pos limit 1}, 0).text}}
{{/let}}
4 Likes