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

Archives: Make the label above the dropdown editable #57528

Open
carolinan opened this issue Jan 4, 2024 · 4 comments
Open

Archives: Make the label above the dropdown editable #57528

carolinan opened this issue Jan 4, 2024 · 4 comments
Labels
[Block] Archives Affects the Archives Block Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Enhancement A suggestion for improvement.

Comments

@carolinan
Copy link
Contributor

What problem does this address?

The archives block has an option to display the result as a dropdown.
When this option is enabled, there is a second option to show a label.
This label can not be edited, it always say "Archives" (This entire block is disabled).

What is your proposed solution?

Make the label editable.

@carolinan carolinan added [Type] Enhancement A suggestion for improvement. [Block] Archives Affects the Archives Block Good First Issue An issue that's suitable for someone looking to contribute for the first time labels Jan 4, 2024
@colinduwe
Copy link
Contributor

I gave this a whirl but got stumped by index.php. Is there a way to check if this is the editor vs. the front end?

Screenshot 2024-01-05 at 2 12 47 PM

@marincarroll
Copy link

I gave this a whirl but got stumped by index.php. Is there a way to check if this is the editor vs. the front end?

Why do you need to check for this? Sorry if I'm misunderstanding, but what's in your screenshot looks correct.

@colinduwe
Copy link
Contributor

@marincarroll Ideally the label would be a richtext within the editor rather than a textbox in the sidebar. I did that here: #58856 but I never did find an elegant way to signal to the render callback that it was being called by the editor vs the front end which led to a rather klugy work around. I'd welcome any suggestions for how it might be improved.

@marincarroll
Copy link

@marincarroll Ideally the label would be a richtext within the editor rather than a textbox in the sidebar. I did that here: #58856 but I never did find an elegant way to signal to the render callback that it was being called by the editor vs the front end which led to a rather klugy work around. I'd welcome any suggestions for how it might be improved.

Ah, okay, I was wondering the same thing. From what I understand, ServerSideRender is discouraged for new blocks and is being phased out, but looking at wp_get_archives it seems like creating an editor preview would be quite an involved process in this case.

I'm curious if there are plans to replace ServerSideRender in this block, but since that's likely a while off, I personally feel like your current solution is not bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Archives Affects the Archives Block Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants