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

Best approach with Grav to display list of documents on multiple pages?

Started by Muut Archive 11 years ago · 10 replies · 488 views
11 years ago

For a course site I am trying to build with Grav, I will have 10-20 documents stored on OneDrive. Rather than duplicate listing certain files in multiple .md files I'd like to store them somewhere once and then use some sort of find command to match certain ones and then list them.

Right now I am thinking of creating a modular page, with n folders, each containing one .md file with a linked worksheet and use the find.page function which I've used before.

Is the above a reasonable way to do things, or is there another recommended best practice? I do not want to over-engineer this either, but trying not to manually duplicate content on the site.

Thanks very much,
Paul

11 years ago

From your original description of requirements, I think that taxonomy (like tags) and then different page with collections based on different tags sounds like it is a better fit for you needs.

11 years ago

Thanks for the advice, might there be an example of that approach I could learn from?

11 years ago

That looks like a good lead, thanks very much.

11 years ago

Did you get it to work?
I would also like to use the same system but I'm struggling to get it work on the skeleton called "Blog Site", regardless of documentation information.
I'm testing out if my Tumblr-page could be a simple Grav-site. The buttons on the left simply show posts related to a tag.

11 years ago

Hi Manu, I have not yet had a chance to try this out but plan to do so in the next day or so. I will share the results and any TWIG examples here.

11 years ago

Thanks for posting :) I will look into it

11 years ago

In particular, explore these files:

/pages/07.worksheets/worksheets.md
/themes/mytheme/templates/worksheets.html.twig
/pages/07.worksheets/_content-inventory-with-prioritization/worksheet. md
/themes/mytheme/templates/modular/worksheet.html.twig

/pages/02.fundamentals/_04.module-worksheets/module-worksheets.md
/themes/mytheme/templates/modular/module-worksheets.html.twig

Please post any follow-up questions you may have.

11 years ago

Ah, that's very good to know for future reference if I happen to put more sections to my blog.

I also put together some tests and the following structure seems to work fine for my purposes. However, the Home-page doesn't yet show all the posts like I want it to, need to fiddle around it more later.

Grav_settings

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1322 9 years ago
Archive · by Muut Archive, 9 years ago
2 917 9 years ago
Archive · by Muut Archive, 9 years ago
2 4048 9 years ago
Archive · by Muut Archive, 9 years ago
1 2922 9 years ago
Archive · by Muut Archive, 9 years ago
3 1106 9 years ago