Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

Rendering page content on another page

Solved by pamtbaau View solution

Started by Josh 5 years ago · 2 replies · 701 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 jean-louis67, 3 weeks ago
2 308 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 310 3 weeks ago
General · by Veehem, 4 weeks ago
0 263 4 weeks ago
General · by milkboy, 4 weeks ago
0 264 4 weeks ago
General · by ian russell, 1 month ago
2 335 1 month ago