Gutenberg: New Block: Post Author

Created on 16 Jan 2020  Â·  19Comments  Â·  Source: WordPress/gutenberg

As indicated in https://github.com/WordPress/gutenberg/issues/15623, there will be a suite of Post blocks that make up the Post template.

This is the Author block.

Features

  • Author block should handle display name or real name.
  • Link to profile or author archives.
  • Display a gravatar.
  • Allow change of author.

There should be explorations around how to achieve bylines with text like “By {authorName}“.

Mockups

Screen Shot 2020-01-15 at 5 22 06 PM

Questions

  • Can we link the author to the profile or author archives by limiting only those two options from the link icon in the Toolbar? This would be preferable to the sidebar setting option.
Needs Design Feedback New Block [Status] In Progress

Most helpful comment

Maybe a button "add byline" in the toolbar can work.

All 19 comments

Can we link the author to the profile or author archives by limiting only those two options from the link icon in the Toolbar? This would be preferable to the sidebar setting option.

Yes. Can we also make the actual block editable as well? Instead of changing the author in the sidebar, you would do it directly on the block while it is selected.

Should we have some mechanism that only allows valid user names to be inserted in the block? I don't think it should be free form editing, do you? This is why I restricted it to a dropdown. If it can be done another way in the block, let's give it a try.

Yes, an inline combobox.

Some thoughts and challenges:

  • Should have customization options for the link aspects (these should ideally be shard with things like navigation item in menus) — color, size, underline.
  • Likely needs to handle display name vs full name.
  • Should have both view only and edit modes (switching author).
  • Should have a state for template editing that shows placeholder "author name" generically.
  • Should author bio be a separate block or a setting?

How would bylines be achieved? Cases like “Written by {authorName}“. In these cases the block functions more like an inline token, but that is not a great for discovery and UX reasons. Would it make sense to have a field in the sidebar for "prefix" / "suffix" on this block? (Once added it should be directly editable.)

Should have customization options for the link aspects (these should ideally be shard with things like navigation item in menus) — color, size, underline.

Yes, we need to reuse link controls.

Likely needs to handle display name vs full name.

Yes, Mark mocked that up.

Should have both view only and edit modes (switching author).

Agreed, when selected it should switch to edit mode.

Should have a state for template editing that shows placeholder "author name" generically.

Yeah.

Should author bio be a separate block or a setting?

I'd say it belongs in this block. A lot of concerns are shared. If someone wants to separate a byline from the bio they can just use two of these blocks.

How would bylines be achieved? Cases like “Written by {authorName}“. In these cases the block functions more like an inline token, but that is not a great for discovery and UX reasons. Would it make sense to have a field in the sidebar for "prefix" / "suffix" on this block? (Once added it should be directly editable.)

I suggest we have an inline token local to this block for the author's name part. The rest would just be edited like a regular paragraph block.

Maybe a button "add byline" in the toolbar can work.

Yes, that would work.

I suggest we have an inline token local to this block for the author's name part. The rest would just be edited like a regular paragraph block.

@epiqueras is there another block using this idea of inline tokens?

No.

I would try an approach like #19715 first with input before and after the author's name.

Hey @mapk ! I am advancing on this block in this PR #19894. I am not sure how you'd imagine linking the author, without the inspector.

@mtias suggests edit and view modes, then, UI-wise, would edit simply be a special LinkEditor?

In the comments above there is also the idea of having the author bio in the same block. However the author bio may be quite long, where would that fit with the small space this block is by default? I am thinking a simple paragraph, below the name, that would be full width of the block's parent.

Also, what does the "Add author" button in the mock-up inspector do?

While thinking about this, if the user is able to edit the Author's name in the block, change the color of the text, and link the name to the bio, or wherever... this block begins to feel like a simple Paragraph block.

So let me push back a little. Maybe a block such as this one should be more limited with what it allows. It's being used for a very specific need – to show the author of the post.

With this in mind. I believe it should inherit the author's name from the Post itself. If the user is allowed to edit the author's name, then that feels like a secondary action which should reside in the Inspector. Having toggles there that allow the user to add/remove specific content, or change the display name feels right to me.

Author with Avatar

1

Author with all the fixins

2

Author with Style Variation (Large)

3

These should definitely be iterated on. I'm just trying to get some ideas out there in regards to settings and how those settings may effect the overall layout of the block.

Couldn't the same combos be achieved with scoped block patterns? This would be nicer as you could further customize things through direct manipulation of the blocks used.

Couldn't the same combos be achieved with scoped block patterns?

Yes, but then it's a Block Pattern and not a block, right? Which is do-able if we want to pivot our efforts here.

They would be block patterns/variations of the Post Author block.

We could benefit from being more granular and have things like the Post Author Avatar be a block itself that you reposition freely and combine with static content as well as things like the Post Author Name.

Like child-blocks of the Post Author block! So these blocks wouldn't be available outside the Post Author block. Does this get too meticulous for a block that just needs to show some author related stuff?

I'm open to trying it out.

It depends on how we do it. This is a good use-case for a more inline block
UI.

@mapk would the byline and the author description be editable as well?

@mapk would the byline and the author description be editable as well?

I believe the byline can be editable. The bio should not be editable unless there's a way we can update what's on the user's profile page and inform the user that they're making a global change.

Screen Shot 2020-01-30 at 7 50 15 AM

I think, for the first iteration, we just add the bio or not. If they want to change it, they can do so on the user profile.php page. What do you think?

There is a way to do it just like all the other global changes.

Happy to leave it for a later iteration, too, though.

Was this page helpful?
0 / 5 - 0 ratings