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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

Multiple markdown files within a folder

Started by Muut Archive 12 years ago · 2 replies · 665 views
12 years ago

Hey guys, I am using the blog skeleton and am wanting to have the post.md file within a post folder, along with an email.md file. The email.md file will have the markdown content for the blog post related email template we will setup as a twig template file. Couple of questions:

1) Is the above possible?
2) Is it possible to build a template page that uses the YAML data from the post.md file and used the markdown content from the email.md file?

Thanks so much.
Josh

12 years ago

Each folder should have only one unique .md file. Grav will grab the first .md file it comes across and the other will be ignored.

I think the second question is really what your trying to achieve, and yes this can be done, but you need to set up each .md file in their own folders. Then you can access multiple .md files from within a twig template by finding the second page and assigning the content to a variable:

see page.find()

Let me know if that answers your question.

12 years ago

Thanks so much for the quick response. That definitely helps.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1280 9 years ago
Archive · by Muut Archive, 9 years ago
2 888 9 years ago
Archive · by Muut Archive, 9 years ago
2 4018 9 years ago
Archive · by Muut Archive, 9 years ago
1 2893 9 years ago
Archive · by Muut Archive, 9 years ago
3 1077 9 years ago