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

Empty post placeholder #1082

Closed
youknowriad opened this issue Jun 8, 2017 · 9 comments · Fixed by #1195
Closed

Empty post placeholder #1082

youknowriad opened this issue Jun 8, 2017 · 9 comments · Fixed by #1195
Assignees

Comments

@youknowriad
Copy link
Contributor

Now that we have a direct "New post" link, should we add a global placeholder "Start writing"(or similar)?

I wonder if we should automatically add an empty text block (with this placeholder) to all new posts.

@paaljoachim
Copy link
Contributor

paaljoachim commented Jun 8, 2017

I am experimenting with a few things...

We can move the title to the top and for instance add some initial words that says add a block to begin creating your layout. The words go away after the first block has been added.

gutenberg-add-first-block

Here is an empty text block:

gutenberg-first-block

gutenberg-first-block2

@mtias
Copy link
Member

mtias commented Jun 8, 2017

@youknowriad yes, let's get an empty text block there. The placeholder should be the default for the block (i.e. if the default was an image, it'd be the image placeholder, etc.) We'll see if #798 pans out.

@jasmussen
Copy link
Contributor

jasmussen commented Jun 9, 2017

Here's how I've been imagining it:

empty post

Not sure about the "(optional)" part — perhaps that's premature. The idea is that we are also looking to retire post formats, and you might have a post format that doesn't include a title. But this is probably better solved by making the post title an actual block that you can remove, down the road.

Below that, like Matías says, is a text block. Or the default block you decided in #798.

By the way I appreciate your mockups, @paaljoachim, it's good to have a diversity of ideas here!

@aduth
Copy link
Member

aduth commented Jun 9, 2017

@paulwilde For constructiveness' sake, can you elaborate on your reaction to @paaljoachim's comment?

@paulwilde
Copy link
Contributor

paulwilde commented Jun 9, 2017

@aduth I'm just not a huge fan of the placement of the title in the toolbar. It has the disadvantage of not being able to support multi-line so you need to horizontality scroll should the title be longer than the input field width.

Also there would need to be a lot of considerations on its placement on mobile also, which currently isn't a concern (I believe?).

Separating it outside of the content canvas might also be a little confusing to some users, as it could suggest that its more of an internal title rather than content which (for the most part, depending on the theme) is output on the page.

@paaljoachim
Copy link
Contributor

@paulwilde That is a very valid point! One that I did not think about.
For responsiveness and a possible long title it would likely be better to keep it where it is today.

@youknowriad
Copy link
Contributor Author

I'm starting to think about the technical details of the first version of this. We have several options:

Append an empty block in the block list when initializing the editor

Pros:

  • Simplicity
    Cons:
  • If we save a post without any change, we would have an empty text block in it.
  • If we delete the text block placeholder, we won't have any block in the page

During the render, fallback to a empty text block if the block list is empty

Pros:

  • If we delete all blocks, the placeholder block will show up
  • The post would contain no block unless we effectively type something into this placeholder block

Cons:

  • A bit complex since the VisualEditorBlock component is really tied to the fact that the block being rendered is in the state. Even if we try to drop this constraint, the behaviour between the placeholder block and a regular block is slightly different (updating means inserting, removing do nothing, merging with blocks don't exist, splitting means creating two blocks...)

Thoughts on this @aduth

@mtias
Copy link
Member

mtias commented Jun 15, 2017

If we save a post without any change, we would have an empty text block in it.

This is ok and speaks to the ability of saving "ready made templates" as page content (think the About page that already comes with WordPress, or the hello-world post).

This should also be a configurable setting in PHP for plugins, etc.

@jasmussen
Copy link
Contributor

I've been having some thoughts here also, which tie into the default block also.

The idea is, essentially, to show a "fake" block at the bottom, with a writing prompt inside (like "Write your story"). It's just a big button, but if you click it, it becomes your default text block. Then on the right side there's a small dropdown that lets you select what this default text block is. Defaults to single p text, but you could potentially pick freeform, or even let a markdown block register itself here.

The inserter plus would sit below this.

I'm still thinking about this and want to provide a mock-up, but this is the general idea.

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 a pull request may close this issue.

6 participants