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

Custom page creation modal in Admin

Started by Alexander Kim 8 years ago · 5 replies · 808 views
8 years ago

Template selection via custom page creation modal is selected with the name.
So if you want to use the sometemplate.html.twig template you would have to use

YAML
name:
  type: hidden
  default: 'sometemplate'

For adding taxonomy, this is instead done on the page blueprint itself, not on the creation modal, you can add a default attribute with your tag.

hope it helps

8 years ago

@paul:
name:
type: hidden
default: 'sometemplate'

I've tried this and it didn't work for me. You just provide path to template like mainpage.html.twig or you give full path?

@paul:
For adding taxonomy, this is instead done on the page blueprint itself, not on the creation modal, you can add a default attribute with your tag.

If i do this in a blueprint, then all news would have the same category, i want to set custom default category when using this custom page creation modal, is this possible?

8 years ago

no, you just use the template name, without the .html.twig extension example:
mytemplate.html.twig -> mytemplate
blog-article.html.twig -> blog-article

If i do this in a blueprint, then all news would have the same category, i want to set custom default category when using this custom page creation modal, is this possible?

It is not possible afaik

8 years ago

@paul:
no, you just use the template name, without the .html.twig extension example:

mytemplate.html.twig -> mytemplate

blog-article.html.twig -> blog-article

I've used twig extension ... 🙂 That's why it didn't work, ty. If i do not mention default template what it will be using?

@paul:
It is not possible afaik

Page creation modal functionality is very limited as i understand? It's just a modal to create a page? Can't set custom field values using it? Only in a page blueprint?

8 years ago

Page creation modal functionality is very limited as i understand? It’s just a modal to create a page? Can’t set custom field values using it? Only in a page blueprint?

Yes, at least for now

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 85 13 hours ago
General · by pamtbaau, 18 hours ago
1 60 17 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 350 5 days ago
General · by Duc , 6 days ago
3 44 5 days ago