Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Rendering page content on another page

Solved by pamtbaau View solution

Started by Josh 5 years ago · 2 replies · 757 views
5 years ago

I'm having a basic problem of not being able to display page content on another page. In a page .md file I have this:

YAML
process:
    markdown: true
    twig: true
---
{{ page.find('/05.test').content }} 

But it's not rendering the 'test' page content. What am I doing wrong?

5 years ago Solution

@skipper, Try leaving out the number. The parameter of find is a url not the folder name.

See https://learn.getgrav.org/17/api#class-grav-common-page-page

find( string $url , bool $all=false )

You should also add the |raw filter, else the content will be auto-escaped.

TWIG
{{ page.find('/typography').content | raw }}

Suggested topics

Topic Participants Replies Views Activity
General · by jeremycherfas, 1 week ago
4 180 2 days ago
General · by lynbor, 5 days ago
2 119 3 days ago
General · by Old Man Umby, 1 week ago
1 100 1 week ago
General · by Sebastian, 1 week ago
1 124 1 week ago
General · by Andy Miller, 3 weeks ago
0 248 3 weeks ago