-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Conversation
Size Change: +834 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
Here's an icon for Archive Title:
It's drawn in the style of post title and site title: 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: But that one isn't well balanced. For now, I broke up the text to indicate more words: SVG here:
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! |
Thanks so much for the icons @jasmussen! Really appreciate it! The
I totally agree! |
I have tested the PR with the TT1 Blocks theme to the best of my ability. 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. |
What is this block supposed to do? Trying to understand it more? Can you share some example of outputs? |
It prints |
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 This block does make sense for
@carolinan this makes sense. |
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 |
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. |
Do you think there are other possible values in a
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? |
The idea of a |
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:
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. |
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. |
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. |
9585b0f
to
47aae1b
Compare
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. |
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. |
Use icon from #27989 (comment)
* 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>
Closing, as #29428 was merged instead. |
@carolinan I'm reopening as draft to keep the |
Based on original work in WordPress#27989
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 anArchive Title
and aSearch 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:
text replacements
like inSearch Title
get_the_archive_title
hooksearch
templates, augmented withtext replacements
like%search%
will be replaced by thesearch 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
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.text replacements
per block variation is needed. Now there isn't any, as this will need some design.Checklist: