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.

Plugins

Is there a way to really extend functionality?

Started by Koczka Ferenc 7 years ago · 1 replies · 569 views
7 years ago

I want to add an extra functionality to Grav. It would be pretty simple, the admin should record persons data (name, position ans some others), and the visitor should read this data on a public page. Like a simple staff module.
Please help me how should I create this. I'm able to write the necessary programs but I don't know how can I connect it to Grav. As I think, plugins do only something with the output, I can't imagine how could I use them for solve my problems. Unfortunatelly I'm not able to find any working example which showed a form, read its data, record it on the admin part, and shows its data for the user.
I would be happy if I find a working example or point me the correct part in the documentation. Thank you.

7 years ago

I'm not sure if I understand correctly what you want to do, but I think it is:

  • have a form where you can put in personal data (name....)
  • this form should only be visible/usable by logged in admin
  • upon submit, data should be stored somewhere for retrieval
  • stored data should be published on a publicly visible page

if so, should not be too hard:

  • write a template with desired form.
  • be sure this is only visible to the admin
  • save data from form somewhere in user/data - preferably as an .yml file
  • write a plugin that retrieves this data and display on a page

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 43 1 week ago
Plugins · by Xavier, 4 weeks ago
2 53 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1179 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 47 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 71 2 months ago