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

Data folder?

Started by Muut Archive 12 years ago · 8 replies · 534 views
12 years ago

I'm learning Grav (nice work!), and it would be really helpful to see an example of using the "data" that goes in the data folder. (I couldn't find this in the documentation.)

I'm trying to build a photo gallery with metadata and it's a bit tedious to create a folder for every single image in a subfolder.

Any ideas? Thanks!

12 years ago

Data folder is unused currently. It is there in preparation for our Forms plugin that is not released yet. It will have the option of email and/or storing form data in that folder.

Of course it can be used for other things if you like, but there's currently nothing else that uses it.

12 years ago

I have a follow up question, is there a data persistence api planned? I'm thinking of the best way to make a commenting system, so far I found this thread: http://codingforums.com/php/157582-creating-post-comment-system-using-flat-files.html

Which is why I'm wondering about the data folder. The other way I thought would be to create a *.xml file in the same directory the default.md file is located for pages that have commenting enabled.

12 years ago

There is no persistence API planned as such, however all the necessary libraries are available to store data as YAML and/or Markdown pages.

We have discussed the possibility of a commenting or even forum-type plugin that stored data as sub-pages of the blog post being commented on. It's theoretically possible and the methods to create and even copy or move pages are already in the Grav codebase.

11 years ago

Raising this question up again. How can i get a file stored in data folder? Example: A link to PDF file. PDF stored in data. OR pdf should be stored somewhere else?

11 years ago

The data folder is not intended to be web accessible. It's for storing data such as form submission information. Put PDFs and things in your pages folders.

11 years ago

Thank you. Can i just put it to Pages directory or into 01.some dir?

11 years ago

Ok, can you help me with the path for site.yaml?
menu:
url: ?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1348 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2946 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago