Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Any tutorial on "how to build my own page template"?

Started by Naor Penso 9 years ago · 1 replies · 710 views
9 years ago

Hi!

I have seen the detailed Grav documentation about pages and content types but i cannot get my head around creating my own page template.
The template should be a "closed" template in which there are input fields, after filling all fields the page can be saved.
In example, using the default template provided with Grav (antimatter) there are the following types within a page: blog, default, error etc.

What i would like to achieve is having another page template called "KB article" in which i will predefine the structure, possible inputs etc.

Note:
I have tried to replicate the page.yaml and change the type just to validate but i get the following error:

RuntimeException (400)
Template "kb.html.twig" is not defined.

Thanks ☀️
Naor

last edited 03/02/18 by Naor Penso
9 years ago

Hi ,

If you have created a kb.yaml in the user/themes/'mytheme'/blueprints , you must create a kb.html.twig in the "/user/themes/'mytheme'/templates" folder

Suggested topics

Topic Participants Replies Views Activity
General · by jeremycherfas, 1 week ago
4 181 2 days ago
General · by lynbor, 6 days ago
2 124 3 days ago
General · by Old Man Umby, 1 week ago
1 100 1 week ago
General · by Sebastian, 2 weeks ago
1 124 1 week ago
General · by Andy Miller, 3 weeks ago
0 248 3 weeks ago