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

2 markdown files in one folder? or can a modular page use nested subfolders?

Started by Muut Archive 11 years ago · 3 replies · 789 views
11 years ago

Is it possible to put two .md files in one (sub) folder?
Problem is:
I want to modify a single twig layout to use different 'content' for a two column layout.
The second column should display the content of a different .md file.
So the twig should use a reference to a different .md
How can I get there?
Can a modular page use nested subs?
Example:
01.home: _showcase

  • -showcase1 - -showcase2
    Thanks!
11 years ago

You cannot have multiple .md files in a folder. You will with multilanguage support, but those will be different versions of the same file/page.

I would advice creating a modular page 01.home\modular.md that has two modular sub pages for 01.home\_col1\column.md and 01.\home\_col2\column.md.

The modular.html.twig should render the two modular subpages as columns with the appropriate HTML syntax. The column.html.twig would probably not be very complex as it's just for rendering the content of the columns.

You can use the one-page skeleton as an example to follow. Even though it renders the modular pages in horizontal stripes down the page, it's basically the same as you would need for rendering multiple columns, just different HTML.

11 years ago

Thanks for the tip. I will try.
My modular page has 6 sub pages. And only the first sub page should use a two column layout...(with reference to content of 2 different .md files). So can a modular subpage (showcase) consist of 2 or more subpages( showcase1, _showcase2,...) ?

11 years ago

Theoretically it should, never tried though :)

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1332 9 years ago
Archive · by Muut Archive, 9 years ago
2 923 9 years ago
Archive · by Muut Archive, 9 years ago
2 4053 9 years ago
Archive · by Muut Archive, 9 years ago
1 2931 9 years ago
Archive · by Muut Archive, 9 years ago
3 1109 9 years ago