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.

General

Creating content dynamically from a csv file using PHP

Solved by Karmalakas View solution

Started by Simon Humphreys 4 years ago · 3 replies · 659 views
4 years ago

As part of my journey looking into Grav ... I had a site (GetSimple CMS, but this seems to have fallen over hence looking into a lightweight/similar replacement) that took data for events from a .CSV file and then generated an events listing page dynamically populating the page for either a listings or single event page using some trivial PHP functions to handle reading the file and generating the HTML.

I'm assuming Grav is capable of something similar but I am having difficulty getting my head round how this might work especially as Grav pages, via Twig, are rendered as HTML.

Can anyone point me to anything I might read on how to do this?

Thanks

4 years ago Solution

Sounds like you will need a custom plugin. You can start by checking this one and then implementing your own logic

👍 1
4 years ago

you could also take a look at this plugin which creates an events listing page from an .ics (calendar) file.
should not be too hard to modify this so it can read events from a .csv file instead.

👍 2

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 76 8 hours ago
General · by pamtbaau, 13 hours ago
1 47 12 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago