gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Pages data view: mark homepage and posts page

Open jameskoster opened this issue 2 years ago • 1 comments

In wp-admin this is achieved with a text label:

Screenshot 2024-01-11 at 14 21 48

In the current pages list the homepage and posts page appear at the top with icons to denote their purpose:

Screenshot 2024-01-11 at 14 22 22

In the pages data view there is no indication at all about which page serves as the homepage / posts page. Lets come up with a design to achieve this.


There are other situations where such a pattern can be useful – for instance the privacy policy page in core, and the shop / cart / checkout pages are also marked this way – so it could be worth implementing this in a reusable/extendable fashion.

jameskoster avatar Jan 11 '24 14:01 jameskoster

Accounting for the different layouts I think the safest initial approach here may be to add a text label:

page marking

jameskoster avatar Jan 12 '24 16:01 jameskoster

Is this the same "badge" kind of fields that we have in "patterns" for the sync status? Because the design looks different to me in the mockups.

youknowriad avatar May 15 '24 10:05 youknowriad

It depends whether this data is a field, technically speaking. I could be convinced otherwise, but I didn't see it as one for a couple of reasons;

  1. There can only be one home / posts page
  2. I don't know that you'd ever sort / filter by 'is home page'
  3. It doesn't feel like a field you'd ever toggle off, and given all pages except one would be false, it seems a waste of space in the table.

My feeling was that it should be a badge, appended to the title field. Ideally we graduate the badge to a component for consistent display, but that can happen later.

jameskoster avatar May 15 '24 11:05 jameskoster

Ok, so you're saying that this is just a different rendering for the "title" field. That could work.

youknowriad avatar May 15 '24 11:05 youknowriad

Going to give this one a quick shot.

oandregal avatar May 16 '24 12:05 oandregal

PR at https://github.com/WordPress/gutenberg/pull/61718

oandregal avatar May 16 '24 12:05 oandregal