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

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

Started by Naor Penso 8 years ago · 1 replies · 560 views
8 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
8 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 Jerry Hunt, 4 days ago
2 82 10 hours ago
General · by pamtbaau, 16 hours ago
1 53 15 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 347 5 days ago
General · by Duc , 5 days ago
3 41 5 days ago