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

[New block] Query Title block #27989

Closed
wants to merge 5 commits into from
Closed

[New block] Query Title block #27989

wants to merge 5 commits into from

Conversation

ntsekouras
Copy link
Contributor

@ntsekouras ntsekouras commented Jan 5, 2021

Description

This PR will add a new Query Title block and is part of:#22724.

It started as an Archive Title block but we should make it more generic. This PR needs feedback for more use cases of this block. Besides an Archive Title and a Search Title we need to determine what else can be or should be supported. (#27989 (comment))

I implemented the Query title with block variations that could be used in different places. Specifically:

  1. Custom query title - a RichText input that could later be augmented with other text replacements like in Search Title
  2. Archive title - the archive title, not editable but filterable by get_the_archive_title hook
  3. Search title - a title that can be used in search templates, augmented with text replacements like %search% will be replaced by the search query in php.

Archive Title variation currently doesn't support any preview in the editor as this is part of detecting the proper context, which is not implemented yet. You can still though select heading level, colors etc..

Notes

  1. New icons should be created (Query Title, Search Title)
  2. By using the postTitle icon, I noticed a bug in the icon which is also fixed here. The bug was setting the color explicitly, so when selected in Navigation list, it was still black.
  3. A way of showing and easily inserting the available text replacements per block variation is needed. Now there isn't any, as this will need some design.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@ntsekouras ntsekouras added New Block Suggestion for a new block [Feature] Full Site Editing labels Jan 5, 2021
@ntsekouras ntsekouras requested a review from a team January 5, 2021 11:01
@ntsekouras ntsekouras self-assigned this Jan 5, 2021
@ntsekouras ntsekouras changed the title Add Archive Title block [New Block] Archive Title block Jan 5, 2021
@ntsekouras ntsekouras changed the title [New Block] Archive Title block [New block] Archive Title block Jan 5, 2021
@github-actions
Copy link

github-actions bot commented Jan 5, 2021

Size Change: +834 B (0%)

Total Size: 1.28 MB

Filename Size Change
build/block-library/blocks/navigation/editor-rtl.css 1.46 kB +79 B (+6%) 🔍
build/block-library/blocks/navigation/editor.css 1.46 kB +77 B (+6%) 🔍
build/block-library/blocks/paragraph/style-rtl.css 392 B +2 B (+1%)
build/block-library/blocks/paragraph/style.css 392 B +1 B (0%)
build/block-library/editor-rtl.css 9 kB +24 B (0%)
build/block-library/editor.css 8.99 kB +19 B (0%)
build/block-library/index.js 142 kB +620 B (0%)
build/block-library/style-rtl.css 8.53 kB +6 B (0%)
build/block-library/style.css 8.53 kB +6 B (0%)
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.14 kB 0 B
build/annotations/index.js 3.8 kB 0 B
build/api-fetch/index.js 3.42 kB 0 B
build/autop/index.js 2.84 kB 0 B
build/blob/index.js 665 B 0 B
build/block-directory/index.js 9.08 kB 0 B
build/block-directory/style-rtl.css 1.01 kB 0 B
build/block-directory/style.css 1.01 kB 0 B
build/block-editor/index.js 122 kB 0 B
build/block-editor/style-rtl.css 11.9 kB 0 B
build/block-editor/style.css 11.9 kB 0 B
build/block-library/blocks/archives/editor-rtl.css 196 B 0 B
build/block-library/blocks/archives/editor.css 196 B 0 B
build/block-library/blocks/audio/editor-rtl.css 194 B 0 B
build/block-library/blocks/audio/editor.css 194 B 0 B
build/block-library/blocks/audio/style-rtl.css 225 B 0 B
build/block-library/blocks/audio/style.css 225 B 0 B
build/block-library/blocks/block/editor-rtl.css 283 B 0 B
build/block-library/blocks/block/editor.css 283 B 0 B
build/block-library/blocks/button/editor-rtl.css 576 B 0 B
build/block-library/blocks/button/editor.css 577 B 0 B
build/block-library/blocks/button/style-rtl.css 552 B 0 B
build/block-library/blocks/button/style.css 552 B 0 B
build/block-library/blocks/buttons/editor-rtl.css 345 B 0 B
build/block-library/blocks/buttons/editor.css 346 B 0 B
build/block-library/blocks/buttons/style-rtl.css 419 B 0 B
build/block-library/blocks/buttons/style.css 419 B 0 B
build/block-library/blocks/calendar/style-rtl.css 319 B 0 B
build/block-library/blocks/calendar/style.css 319 B 0 B
build/block-library/blocks/categories/editor-rtl.css 210 B 0 B
build/block-library/blocks/categories/editor.css 209 B 0 B
build/block-library/blocks/categories/style-rtl.css 208 B 0 B
build/block-library/blocks/categories/style.css 208 B 0 B
build/block-library/blocks/code/style-rtl.css 216 B 0 B
build/block-library/blocks/code/style.css 216 B 0 B
build/block-library/blocks/columns/editor-rtl.css 300 B 0 B
build/block-library/blocks/columns/editor.css 299 B 0 B
build/block-library/blocks/columns/style-rtl.css 529 B 0 B
build/block-library/blocks/columns/style.css 528 B 0 B
build/block-library/blocks/cover/editor-rtl.css 524 B 0 B
build/block-library/blocks/cover/editor.css 522 B 0 B
build/block-library/blocks/cover/style-rtl.css 1.3 kB 0 B
build/block-library/blocks/cover/style.css 1.3 kB 0 B
build/block-library/blocks/embed/editor-rtl.css 594 B 0 B
build/block-library/blocks/embed/editor.css 595 B 0 B
build/block-library/blocks/embed/style-rtl.css 489 B 0 B
build/block-library/blocks/embed/style.css 489 B 0 B
build/block-library/blocks/file/editor-rtl.css 314 B 0 B
build/block-library/blocks/file/editor.css 313 B 0 B
build/block-library/blocks/file/style-rtl.css 352 B 0 B
build/block-library/blocks/file/style.css 352 B 0 B
build/block-library/blocks/freeform/editor-rtl.css 2.55 kB 0 B
build/block-library/blocks/freeform/editor.css 2.55 kB 0 B
build/block-library/blocks/gallery/editor-rtl.css 783 B 0 B
build/block-library/blocks/gallery/editor.css 783 B 0 B
build/block-library/blocks/gallery/style-rtl.css 1.17 kB 0 B
build/block-library/blocks/gallery/style.css 1.17 kB 0 B
build/block-library/blocks/group/editor-rtl.css 433 B 0 B
build/block-library/blocks/group/editor.css 432 B 0 B
build/block-library/blocks/group/style-rtl.css 190 B 0 B
build/block-library/blocks/group/style.css 190 B 0 B
build/block-library/blocks/heading/editor-rtl.css 248 B 0 B
build/block-library/blocks/heading/editor.css 248 B 0 B
build/block-library/blocks/heading/style-rtl.css 212 B 0 B
build/block-library/blocks/heading/style.css 212 B 0 B
build/block-library/blocks/html/editor-rtl.css 384 B 0 B
build/block-library/blocks/html/editor.css 385 B 0 B
build/block-library/blocks/image/editor-rtl.css 801 B 0 B
build/block-library/blocks/image/editor.css 800 B 0 B
build/block-library/blocks/image/style-rtl.css 569 B 0 B
build/block-library/blocks/image/style.css 570 B 0 B
build/block-library/blocks/latest-comments/editor-rtl.css 277 B 0 B
build/block-library/blocks/latest-comments/editor.css 275 B 0 B
build/block-library/blocks/latest-comments/style-rtl.css 382 B 0 B
build/block-library/blocks/latest-comments/style.css 382 B 0 B
build/block-library/blocks/latest-posts/editor-rtl.css 254 B 0 B
build/block-library/blocks/latest-posts/editor.css 254 B 0 B
build/block-library/blocks/latest-posts/style-rtl.css 634 B 0 B
build/block-library/blocks/latest-posts/style.css 634 B 0 B
build/block-library/blocks/list/editor-rtl.css 203 B 0 B
build/block-library/blocks/list/editor.css 203 B 0 B
build/block-library/blocks/list/style-rtl.css 201 B 0 B
build/block-library/blocks/list/style.css 201 B 0 B
build/block-library/blocks/media-text/editor-rtl.css 311 B 0 B
build/block-library/blocks/media-text/editor.css 311 B 0 B
build/block-library/blocks/media-text/style-rtl.css 642 B 0 B
build/block-library/blocks/media-text/style.css 640 B 0 B
build/block-library/blocks/more/editor-rtl.css 545 B 0 B
build/block-library/blocks/more/editor.css 545 B 0 B
build/block-library/blocks/navigation-link/editor-rtl.css 503 B 0 B
build/block-library/blocks/navigation-link/editor.css 504 B 0 B
build/block-library/blocks/navigation-link/style-rtl.css 805 B 0 B
build/block-library/blocks/navigation-link/style.css 803 B 0 B
build/block-library/blocks/navigation/style-rtl.css 289 B 0 B
build/block-library/blocks/navigation/style.css 289 B 0 B
build/block-library/blocks/nextpage/editor-rtl.css 507 B 0 B
build/block-library/blocks/nextpage/editor.css 507 B 0 B
build/block-library/blocks/paragraph/editor-rtl.css 236 B 0 B
build/block-library/blocks/paragraph/editor.css 236 B 0 B
build/block-library/blocks/post-author/editor-rtl.css 329 B 0 B
build/block-library/blocks/post-author/editor.css 329 B 0 B
build/block-library/blocks/post-author/style-rtl.css 303 B 0 B
build/block-library/blocks/post-author/style.css 303 B 0 B
build/block-library/blocks/post-comments-form/style-rtl.css 358 B 0 B
build/block-library/blocks/post-comments-form/style.css 358 B 0 B
build/block-library/blocks/post-content/editor-rtl.css 262 B 0 B
build/block-library/blocks/post-content/editor.css 262 B 0 B
build/block-library/blocks/post-excerpt/editor-rtl.css 206 B 0 B
build/block-library/blocks/post-excerpt/editor.css 206 B 0 B
build/block-library/blocks/post-featured-image/editor-rtl.css 453 B 0 B
build/block-library/blocks/post-featured-image/editor.css 453 B 0 B
build/block-library/blocks/post-featured-image/style-rtl.css 223 B 0 B
build/block-library/blocks/post-featured-image/style.css 223 B 0 B
build/block-library/blocks/preformatted/style-rtl.css 193 B 0 B
build/block-library/blocks/preformatted/style.css 193 B 0 B
build/block-library/blocks/pullquote/editor-rtl.css 304 B 0 B
build/block-library/blocks/pullquote/editor.css 304 B 0 B
build/block-library/blocks/pullquote/style-rtl.css 428 B 0 B
build/block-library/blocks/pullquote/style.css 428 B 0 B
build/block-library/blocks/query-loop/editor-rtl.css 217 B 0 B
build/block-library/blocks/query-loop/editor.css 216 B 0 B
build/block-library/blocks/query-loop/style-rtl.css 427 B 0 B
build/block-library/blocks/query-loop/style.css 429 B 0 B
build/block-library/blocks/query/editor-rtl.css 279 B 0 B
build/block-library/blocks/query/editor.css 279 B 0 B
build/block-library/blocks/quote/editor-rtl.css 195 B 0 B
build/block-library/blocks/quote/editor.css 195 B 0 B
build/block-library/blocks/quote/style-rtl.css 284 B 0 B
build/block-library/blocks/quote/style.css 285 B 0 B
build/block-library/blocks/rss/editor-rtl.css 307 B 0 B
build/block-library/blocks/rss/editor.css 309 B 0 B
build/block-library/blocks/rss/style-rtl.css 394 B 0 B
build/block-library/blocks/rss/style.css 393 B 0 B
build/block-library/blocks/search/editor-rtl.css 285 B 0 B
build/block-library/blocks/search/editor.css 285 B 0 B
build/block-library/blocks/search/style-rtl.css 454 B 0 B
build/block-library/blocks/search/style.css 456 B 0 B
build/block-library/blocks/separator/editor-rtl.css 229 B 0 B
build/block-library/blocks/separator/editor.css 229 B 0 B
build/block-library/blocks/separator/style-rtl.css 352 B 0 B
build/block-library/blocks/separator/style.css 352 B 0 B
build/block-library/blocks/shortcode/editor-rtl.css 603 B 0 B
build/block-library/blocks/shortcode/editor.css 603 B 0 B
build/block-library/blocks/site-logo/editor-rtl.css 321 B 0 B
build/block-library/blocks/site-logo/editor.css 321 B 0 B
build/block-library/blocks/site-logo/style-rtl.css 238 B 0 B
build/block-library/blocks/site-logo/style.css 238 B 0 B
build/block-library/blocks/social-link/editor-rtl.css 283 B 0 B
build/block-library/blocks/social-link/editor.css 283 B 0 B
build/block-library/blocks/social-links/editor-rtl.css 811 B 0 B
build/block-library/blocks/social-links/editor.css 810 B 0 B
build/block-library/blocks/social-links/style-rtl.css 1.44 kB 0 B
build/block-library/blocks/social-links/style.css 1.44 kB 0 B
build/block-library/blocks/spacer/editor-rtl.css 416 B 0 B
build/block-library/blocks/spacer/editor.css 416 B 0 B
build/block-library/blocks/spacer/style-rtl.css 184 B 0 B
build/block-library/blocks/spacer/style.css 184 B 0 B
build/block-library/blocks/subhead/editor-rtl.css 223 B 0 B
build/block-library/blocks/subhead/editor.css 223 B 0 B
build/block-library/blocks/subhead/style-rtl.css 210 B 0 B
build/block-library/blocks/subhead/style.css 210 B 0 B
build/block-library/blocks/table/editor-rtl.css 593 B 0 B
build/block-library/blocks/table/editor.css 593 B 0 B
build/block-library/blocks/table/style-rtl.css 501 B 0 B
build/block-library/blocks/table/style.css 501 B 0 B
build/block-library/blocks/tag-cloud/editor-rtl.css 237 B 0 B
build/block-library/blocks/tag-cloud/editor.css 235 B 0 B
build/block-library/blocks/tag-cloud/style-rtl.css 221 B 0 B
build/block-library/blocks/tag-cloud/style.css 221 B 0 B
build/block-library/blocks/template-part/editor-rtl.css 714 B 0 B
build/block-library/blocks/template-part/editor.css 714 B 0 B
build/block-library/blocks/text-columns/editor-rtl.css 220 B 0 B
build/block-library/blocks/text-columns/editor.css 220 B 0 B
build/block-library/blocks/text-columns/style-rtl.css 283 B 0 B
build/block-library/blocks/text-columns/style.css 283 B 0 B
build/block-library/blocks/verse/editor-rtl.css 194 B 0 B
build/block-library/blocks/verse/editor.css 194 B 0 B
build/block-library/blocks/verse/style-rtl.css 215 B 0 B
build/block-library/blocks/verse/style.css 215 B 0 B
build/block-library/blocks/video/editor-rtl.css 617 B 0 B
build/block-library/blocks/video/editor.css 617 B 0 B
build/block-library/blocks/video/style-rtl.css 303 B 0 B
build/block-library/blocks/video/style.css 304 B 0 B
build/block-library/common-rtl.css 1.01 kB 0 B
build/block-library/common.css 1.01 kB 0 B
build/block-library/theme-rtl.css 860 B 0 B
build/block-library/theme.css 860 B 0 B
build/block-serialization-default-parser/index.js 1.88 kB 0 B
build/block-serialization-spec-parser/index.js 3.06 kB 0 B
build/blocks/index.js 48.1 kB 0 B
build/components/index.js 173 kB 0 B
build/components/style-rtl.css 15.5 kB 0 B
build/components/style.css 15.5 kB 0 B
build/compose/index.js 11.3 kB 0 B
build/core-data/index.js 15.2 kB 0 B
build/data-controls/index.js 829 B 0 B
build/data/index.js 8.99 kB 0 B
build/date/index.js 31.8 kB 0 B
build/deprecated/index.js 769 B 0 B
build/dom-ready/index.js 571 B 0 B
build/dom/index.js 4.95 kB 0 B
build/edit-navigation/index.js 11.2 kB 0 B
build/edit-navigation/style-rtl.css 938 B 0 B
build/edit-navigation/style.css 944 B 0 B
build/edit-post/index.js 306 kB 0 B
build/edit-post/style-rtl.css 6.51 kB 0 B
build/edit-post/style.css 6.5 kB 0 B
build/edit-site/index.js 24.2 kB 0 B
build/edit-site/style-rtl.css 4.01 kB 0 B
build/edit-site/style.css 4.01 kB 0 B
build/edit-widgets/index.js 23.6 kB 0 B
build/edit-widgets/style-rtl.css 3.17 kB 0 B
build/edit-widgets/style.css 3.17 kB 0 B
build/editor/editor-styles-rtl.css 543 B 0 B
build/editor/editor-styles.css 545 B 0 B
build/editor/index.js 41.9 kB 0 B
build/editor/style-rtl.css 3.89 kB 0 B
build/editor/style.css 3.89 kB 0 B
build/element/index.js 4.62 kB 0 B
build/escape-html/index.js 735 B 0 B
build/format-library/index.js 6.76 kB 0 B
build/format-library/style-rtl.css 620 B 0 B
build/format-library/style.css 621 B 0 B
build/hooks/index.js 2.27 kB 0 B
build/html-entities/index.js 623 B 0 B
build/i18n/index.js 3.57 kB 0 B
build/is-shallow-equal/index.js 697 B 0 B
build/keyboard-shortcuts/index.js 2.54 kB 0 B
build/keycodes/index.js 1.94 kB 0 B
build/list-reusable-blocks/index.js 3.15 kB 0 B
build/list-reusable-blocks/style-rtl.css 629 B 0 B
build/list-reusable-blocks/style.css 628 B 0 B
build/media-utils/index.js 5.32 kB 0 B
build/notices/index.js 1.85 kB 0 B
build/nux/index.js 3.42 kB 0 B
build/nux/style-rtl.css 731 B 0 B
build/nux/style.css 727 B 0 B
build/plugins/index.js 2.54 kB 0 B
build/primitives/index.js 1.43 kB 0 B
build/priority-queue/index.js 790 B 0 B
build/redux-routine/index.js 2.84 kB 0 B
build/reusable-blocks/index.js 2.92 kB 0 B
build/rich-text/index.js 13.5 kB 0 B
build/server-side-render/index.js 2.77 kB 0 B
build/shortcode/index.js 1.7 kB 0 B
build/token-list/index.js 1.27 kB 0 B
build/url/index.js 3.02 kB 0 B
build/viewport/index.js 1.86 kB 0 B
build/warning/index.js 1.14 kB 0 B
build/wordcount/index.js 1.22 kB 0 B

compressed-size-action

@jasmussen
Copy link
Contributor

Here's an icon for Archive Title:

<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path stroke="#1E1E1E" stroke-width="1.5" d="M4 19.25h9M4 15.25h16"/><path d="M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z" fill="#1E1E1E"/></svg>

It's drawn in the style of post title and site title:

Screenshot 2021-01-06 at 11 48 48

That also poses a slight challenge with the upcoming need for a "Description" icon? The icons above imply multiline titles. So how do we keep that DNA and yet create a "Archive Description", where descriptions are traditionally more multiline? One instinct says, change site title, post title and archive title to have a single line, and reserve the multiline for descriptions:

Screenshot 2021-01-06 at 11 53 49

But that one isn't well balanced.

For now, I broke up the text to indicate more words:

Screenshot 2021-01-06 at 11 56 41

SVG here:

<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path stroke="#1E1E1E" stroke-width="1.5" d="M9 19.25h6M4 19.25h4M12 15.25h8M4 15.25h7"/><path d="M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z" fill="#1E1E1E"/></svg>

I think we can use that for now, because icons are easy to update and shouldn't block the PRs.

For all your opinions on which direction to take those icons, and what tweaks to make, I volunteer to address them. I'm easy to find!

@ntsekouras
Copy link
Contributor Author

Thanks so much for the icons @jasmussen! Really appreciate it! The description icon will be used soon when I'll implement Archive Description block.

I think we can use that for now, because icons are easy to update and shouldn't block the PRs.

I totally agree!

@carolinan
Copy link
Contributor

I have tested the PR with the TT1 Blocks theme to the best of my ability.
The block works as excepted on the front and in the site editor.
I have been unable to test the block in the standard block editor due to unrelated issues with the current Gutenberg master.

I would like to suggest that the text "Archive Title" in the site editor should be changed to indicate that it is a placeholder text.
It would be more consistent with other placeholders. Perhaps simply "Archive title placeholder"?
And that the casing should be updated to "Archive title".

@youknowriad
Copy link
Contributor

What is this block supposed to do? Trying to understand it more? Can you share some example of outputs?

@swissspidy
Copy link
Member

What is this block supposed to do? Trying to understand it more? Can you share some example of outputs?

It prints get_the_archive_title(); which is typically used by themes on archives pages (post type archives, date archives, taxonomy archives)

@youknowriad
Copy link
Contributor

I wonder if this is not the right block to make. It seems what we want is to show the "title" of a "query" block instead which would be more generic and works across usage of Query blocks and not specific to "archive" templates.

@ntsekouras
Copy link
Contributor Author

I wonder if this is not the right block to make. It seems what we want is to show the "title" of a "query" block instead which would be more generic and works across usage of Query blocks and not specific to "archive" templates.

I believe that if we just want a title over a Query block, we will just use a heading block, with any content there...

This block does make sense for archive templates, that is dynamic and filterable.

I would like to suggest that the text "Archive Title" in the site editor should be changed to indicate that it is a placeholder text.

@carolinan this makes sense.

@youknowriad
Copy link
Contributor

I believe that if we just want a title over a Query block, we will just use a heading block, with any content there...

That's not what I'm saying. I'm saying you could drop a "Query title" block inside a "Query" block and it will automatically display the title depending on the query arguments similarly to how get_the_archive_title does it.

@carolinan
Copy link
Contributor

carolinan commented Jan 7, 2021

A query title makes sense, I can't think of a scenario right now where you would want the archive title, but not the loop.

@ntsekouras
Copy link
Contributor Author

ntsekouras commented Jan 7, 2021

I'm saying you could drop a "Query title" block inside a "Query" block and it will automatically display the title depending on the query arguments similarly to how get_the_archive_title does it.

Do you think there are other possible values in a Query Title besides:

  1. get_the_archive_title
  2. Custom text (which can be handled by a simple heading)

I can't think of any different contents. If that's the case, I don't see why name it more generic.

There are other specific blocks, like Post Blocks that doesn't make sense in archive pages (outside Query). I thinks it's the same thing in the other direction.

@youknowriad do you mean to have the same block with different name and editable to handle the non-archive cases?

@pattonwebz
Copy link
Member

The idea of a query title rather than an archive title block makes a lot of sense to me and seems like it could have more general purpose uses than a block just for archive titles.

@youknowriad
Copy link
Contributor

A Query Title is probably a bit harder to build than a simple Archive Title block relying on the existing function but it's more generic.

The two use-cases I can think of right now are:

  • For instance, the search results could use it too: "Search results for %search%"
  • Archives of course: "Posts of %year%"

but I bet if we look more on existing themes, we could find other titles that could apply in this context.

Looking at this issue #22724, I feel we shouldn't try to bring all of these functions to blocks 1-1. Things can translate differently depending on the function.

Now for how exactly this block would work, I actually have no defined idea yet. I'd love some design thinking to gather as many use-case as possible for such a block first.

One potential solution is to offer some kind of "format picker" with placeholders to be filled from the "Query" args.

@ntsekouras
Copy link
Contributor Author

For instance, the search results could use it too: "Search results for %search%"

This makes sense, yes. I'll wait for some more use-cases feedback, try to find more myself and then decide how it'll be implemented.

@pattonwebz
Copy link
Member

pattonwebz commented Jan 7, 2021

As far as use cases go it seems like the most common ones will be for archives really. My general feeling is that there would be additional use cases for custom queries as well though - I just can't think of any good ones right now.

Something that is failry common is to write custom queries like only categorys 1, 15 & 21 and if a query title block could somehow indicate that it would save coding in custom titles to pages where the queries live. It's not the best example but the only one I can come up with off the top of my head right now. If I think of others I'll come back and share them.

@ntsekouras ntsekouras changed the title [New block] Archive Title block [New block] Query Title block Jan 11, 2021
@ntsekouras
Copy link
Contributor Author

Since there wasn't any new feedback, I thought we could implement this block (Query Title) with block variations as per use case, if needed. So if we come to an agreement with this approach, it will be extensible with new block variations.

The code will need polishing and changes but I'd like to have some feedback about the approach before continuing more.

@ntsekouras ntsekouras mentioned this pull request Jan 20, 2021
26 tasks
@ndiego
Copy link
Member

ndiego commented Jan 25, 2021

Coming to this discussion late, but I like the idea of a "Query Title" block with block variations for Archive, Search, etc. It would be a pretty clean way to implement this rather than separate blocks for each. Regardless, nice work on this. We absolutely need this for FSE.

@ntsekouras ntsekouras mentioned this pull request Feb 4, 2021
6 tasks
@ntsekouras ntsekouras marked this pull request as draft March 1, 2021 11:47
Base automatically changed from master to trunk March 1, 2021 15:45
aristath added a commit that referenced this pull request Mar 9, 2021
@aristath aristath mentioned this pull request Mar 10, 2021
7 tasks
aristath added a commit that referenced this pull request Mar 11, 2021
* WIP for term-description block

* load the block.

* better safe than sorry

* Add more supports

* add fixtures files

* use padding instead of height so border can adapt depending on font-size

* Change the icon

Use icon from #27989 (comment)

* Update packages/icons/src/library/term-description.js

Co-authored-by: Nik Tsekouras <ntsekouras@outlook.com>

* address feedback

* Add description

* reverse condition & logic

* Change placeholder text

* Simplify

Co-authored-by: Nik Tsekouras <ntsekouras@outlook.com>
@carolinan
Copy link
Contributor

Closing, as #29428 was merged instead.

@carolinan carolinan closed this Apr 14, 2021
@ntsekouras
Copy link
Contributor Author

@carolinan I'm reopening as draft to keep the Search Title explorations and avoid someone deleting the branch.

@ntsekouras ntsekouras reopened this Apr 14, 2021
mikachan added a commit to mikachan/gutenberg that referenced this pull request Jul 16, 2021
@ntsekouras ntsekouras closed this Sep 7, 2021
@youknowriad youknowriad deleted the try/archive-title branch September 15, 2021 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Block Suggestion for a new block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants