Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all existing information available on page creation #1175

Merged
merged 1 commit into from
Aug 2, 2017
Merged

Make all existing information available on page creation #1175

merged 1 commit into from
Aug 2, 2017

Conversation

THoenig
Copy link
Contributor

@THoenig THoenig commented Jul 24, 2017

This is a possible solution for #1172.

@rhukster
Copy link
Member

This looks pretty good to me at first glance. I need to test it a bit though before merging.

@rhukster
Copy link
Member

Ok i'm seeing an issue with this PR when creating a new page using the + button:

2017-07-25 at 7 09 pm

These values are being set by the page create modal, but really they should not be set in the frontmatter at all, they are set as properties on the page, which in turn are used to set the values, but only title should be actually stored in the frontmatter. This is why we had that mechanism to create a simple header with only title (and possibly 'visible')

Copy link
Member

@rhukster rhukster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really needs to have logic so that 'new' pages are kept simply to the title/visibility options but existing pages can use the entire header.

@THoenig
Copy link
Contributor Author

THoenig commented Aug 1, 2017

I think i found a simple solution that keeps the default process untouched but adds the ability to handle additional fields.

@rhukster Could you please take a look?

@rhukster rhukster merged commit ecb5ee7 into getgrav:develop Aug 2, 2017
@rhukster
Copy link
Member

rhukster commented Aug 2, 2017

Yup, that works for me :) 👍

@justinhartman
Copy link

@THoenig or @rhukster can one of you tell me how I pass frontmatter options to the 'data' => $data object so that it is saved in the frontmatter on page creation as per this screenshot? I've created an Admin blueprint for new_post.yml as per the Grav Cookbook documentation but, as expected, when my page is getting created via the + Add New Post button in the bar I only have the title, date and author frontmatter set. I want to pass a new frontmatter for hidemenu: true but I can't get that passed to the frontmatter on page creation.

In my new_post.yml I added this:

data:
    hidemenu:
        type:    hidden
        default: 'true'

I assumed that if I used a data: array that is would trigger 'data' => $data and pass the hidemenu: true to the frontmatter on page creation but it's not.

I know I'm missing something really basic but after about 5 hours of trying different things, I simply can't get this to work.

Any assistance would be fantastic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants