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

Use the Query title block to display a "Blog" title on any template #64574

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

snehapatil2001
Copy link
Contributor

What?

This PR introduces a new variation to the Query Title block, enabling it to automatically display a "Blog" title on relevant templates (e.g., index and home templates) when the archive title is not available. This aims to eliminate the need for manually adding a heading block above the query loop on these templates.

Why?

The issue was that on certain templates (like index and home), the archive title did not show anything by default. This required site creators and theme developers to manually add a heading block, which felt redundant. By adding this functionality to the Query Title block, we simplify the process and ensure that a default "Blog" title is automatically displayed when applicable.

Reference: Issue #64567

How?

  • A new "blog title" variation is added to the Query Title block.
  • The block automatically detects if it is being used on templates like index or home and displays the "Blog" title when no other archive title is available.
  • This ensures the block works out of the box on these templates without additional configuration.

Testing Instructions

  1. Open a template that uses the Query Title block, such as an archive, index, or home template.
  2. On the index or home templates, verify that the block now displays a "Blog" title automatically.
  3. On archive or search result templates, verify that the block displays the appropriate archive title (e.g., category name, search term).
  4. Verify that you no longer need to manually add a heading block above the query loop on the index or home templates.

Testing Instructions for Keyboard

  1. Navigate to the Query Title block using keyboard controls.
  2. Ensure that the title is properly focused and can be edited as expected.
  3. Confirm that the block works correctly when using keyboard navigation on index and home templates (displays "Blog") and on archive templates (displays the correct archive title).

Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

Copy link

github-actions bot commented Aug 16, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: snehapatil2001 <[email protected]>
Co-authored-by: codewizard13 <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@shail-mehta shail-mehta added [Block] Query Title Affects the Query Title Block [Type] Enhancement A suggestion for improvement. labels Aug 16, 2024
@snehapatil2001 snehapatil2001 changed the title chore: worked on a issue. Use the Query title block to display a "Blog" title on any template Aug 17, 2024
@codewizard13
Copy link

Hi @snehapatil2001! Appreciate your work on this so far - this is a badly needed feature. However, it appears the merge is blocked - Can you fix the issue so this can get properly merged?

@snehapatil2001
Copy link
Contributor Author

@codewizard13 Fixed the issue. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Title Affects the Query Title Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants