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

[Query-Total Block] Add editable text and visibility toggle for total count in Query Total block #67994

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

Conversation

sarthaknagoshe2002
Copy link
Contributor

Enhancements for: #67629

What?

This update enhances the Query Total block by introducing two key features:

  1. Editable text fields for user-defined customization of displayed content.
  2. A toggle option for hiding or showing the total count when using the rangeDisplay type.

Why?

  • Editable Text provides flexibility for users to modify the default text to match their design or communication needs without overriding block logic.
  • Visibility Toggle allows a cleaner design by giving control over whether the total count is displayed alongside the range.

How?

  1. Editable Text:

    • Added support for rich text editing in the block output for both total-results and range-display types.
  2. Toggle Option:

    • Introduced a new block attribute showTotal.
    • Integrated a toggle control in the block control for visibility management.
    • Adjusted the rangeDisplay rendering logic to include or omit the total count based on user selection.

Testing Instructions

  1. Add a Query Total block to a post or page.
  2. Select the block and verify that the displayed text is editable directly in the editor for both the variations.
  3. Choose the range display option from the toolbar.
  4. Toggle the visibility of the total count using the newly added control from the Block controls.
  5. Verify that the visibility toggle affects the rendered output in both the editor and frontend.

Screenshots or screencast

query-total.enhancements.mov

Copy link

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: sarthaknagoshe2002 <[email protected]>

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

@sarthaknagoshe2002
Copy link
Contributor Author

@gziolo Looking forward for you feedback here 😇

@fabiankaegy fabiankaegy added [Type] Enhancement A suggestion for improvement. [Block] Query Total Affects the query total block labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Total Affects the query total block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants