-
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
Clarify explanation of how 'Convert to Links' works in Page List block #45394
Clarify explanation of how 'Convert to Links' works in Page List block #45394
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @artemiomorales! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
<a href="https://wordpress.org/support/article/navigation-block/"> | ||
{ __( 'Click here' ) } | ||
</a> | ||
{ __( ' to learn more about menu management.' ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't split and concatenate translated strings because they won't translate properly. instead we need to use the translation helper createInterpolateElement
so that the entire chunk can be translated as a whole unit.
{ createInterpolateElement(
__( '<a>Click here</a> to learn more about menu management.' ),
{ a: <a href="https://wordpress.org/support/article/navigation-block" />
) }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the wording updates here but I don't feel confident in approving the changes; please defer to what others say.
We do need to make sure though that we aren't splitting and concatenating translated strings, so once that's resolved I'll remove my block on this.
Thanks for checking this @dmsnell! The splitting of the translated string has been removed. |
Looks better @artemiomorales - just another poke though, it was fine by me to have "Click here" be the link; the only necessity was using the right translation tools to ensure it didn't break in other languages. 👍 |
@dmsnell Got it. Do you want the a tag text to be restricted to 'Click here' like it was previously before you approve this? So this is my first time doing i18n, and I looked at internationalizing JavaScript in the handbook, as well as How to Internationalize Your Plugin, Internationalization and @wordpress/i18n. I'm not sure how I'd go about doing this, but would consider using dangerouslySetInnerHTML, using translation files, or perhaps using wp_localize_script(), all of which seem like overkill when we can just set the link to the whole line, which would be clearer maintenance-wise and probably be a better UX overall. Let me know your thoughts! |
I don't have any feelings on it; I simply responded because I saw you changed more than I had asked for, and I want you to be empowered to make the changes you want without running into the risks.
Did you try the code I included as an example? That should produce a new React component you can embed like any other. const HelpLink = createInterpolateElement(…);
return <div><HelpLink /></div>; |
Apologies! I somehow missed that comment. Thank you for providing this snippet; that makes everything much clearer and is good info for the future. I also have no strong preference either way and decided to just go ahead and commit your suggestion. Much appreciated 🙏 |
Worth noting though: Using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking this one. Very much appreciated.
I wonder if @jasmussen has a view on the wording here?
</p> | ||
<p> | ||
{ createInterpolateElement( | ||
__( '<a>Click here</a> to learn more about menu management.' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid "Click here" as the link. This isn't good for a11y.
The wording should/could be:
Learn more about menu management.
And the whole string could be the link. That way if an assistive tech device encounters the link when browsing the page by hyperlinks it [the link] will make sense without additional context.
<p> | ||
{ createInterpolateElement( | ||
__( '<a>Click here</a> to learn more about menu management.' ), | ||
{ a: <a href="https://wordpress.org/support/article/navigation-block" /> } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we make this open in a new tab?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the updates, there is clearly an improvement over the dry text we have now, but I have a few nits in the comments.
) } | ||
</p> | ||
<p> | ||
{ __( | ||
"Note: if you add new pages to your site, you'll need to add them to your navigation menu." | ||
'If you previously created a menu in a classic theme, converting will allow you to import it.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct! You can import classic menus from the menu selector in the inspector even if your current menu is a page list or contains a page list. Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The experience is that you need to convert to links or create new in order to import a classic menu.
We might like to offer the import feature in the sidebar in all circumstances.
Also remember that the auto-import of classic menus is now in the Gutenberg Plugin so if you have an existing classic menu it will automatically be used and you will never see the page list.
</p> | ||
<p> | ||
{ createInterpolateElement( | ||
__( '<a>Click here</a> to learn more about menu management.' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this addition!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cold not agree more. Providing inline support is key.
I have dropped a comment in the docs tracker to ensure the support article is up to date. WordPress/Documentation-Issue-Tracker#297 (comment)
className={ 'wp-block-page-list-modal' } | ||
aria={ { describedby: 'wp-block-page-list-modal__description' } } | ||
> | ||
<p id={ 'wp-block-page-list-modal__description' }> | ||
{ __( | ||
'To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.' | ||
'We’ve provided a default list of your published pages so you can get started quickly. If you’d prefer to edit this menu, click the Convert button below — converting will allow you to add, re-order, and remove items, or edit their labels.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Who is "we"? Do we have other places with this form of addressing in WP?
- Coule the disatvantage be squeezed in? Converting will lose the auto updating of the menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@draganescu Is there a "tone of voice" document somewhere for guidance on writing these sorts of user facing messages? Surely Core has something although I came up with nothing when searching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points, @draganescu!
-
I had not thought about it but I get that the "we" can sound a bit odd. How about the following:
"This is a default list of your published pages so you can get started quickly." -
I agree that we should mention how this change will prevent "auto-updating" from working. Maybe we could add it at the very end:
"Please note that if you add new pages to your site, you'll need to manually add them to your navigation menu."
Thank you for the ping Dave, thank you for the PR Artemio and the original issue Alvaro! It seems fine to edit the text to provide clarity. However a few notes:
The main improvement we can add is clarity around where these pages are coming from. But the current first paragraph is a little confusing to me. Perhaps something along these lines?
The following phrase was removed. Are we sure we don't need it? The fact that the Page List menu stays in sync when you add or remove pages from your site feels to me like the single most important thing to highlight.
The following is confusing to me:
CC: @SaxonF as he's had some thoughts around repurposing the Page List block to be called "Auto-menu", that term could potentially be useful in the prose here. |
Thank you all for the feedback and discussion! I can update the pull request after @SaxonF has a chance to offer insight, and once there's agreement on what the wording should be and how to handle the link to the documentation. |
Thank you for your thoughts @jasmussen
I agree. We should keep this sentence. I also agree about the fact that having more text reduces the chances of people reading through and make it more scary.
We could link to https://wordpress.org/support/article/navigation-block/#add-all-pages instead? (please note that the article is pending an update)
I would love to find a systematic approach to adding unobtrusive inline support links. Are you aware of any initiatives around this? |
The problem is, the "Add all pages" button doesn't exist anymore, and big efforts are underway to improve the flow in #42257.
I've seen in a few places links added to the block description, here: However this is mainly for the most complex of blocks like query as shown here, and would not be appropriate for Paragraph, for instance. I recognize the navigation block has a great deal of complexity and would meet that threshold. The main challenge there is that adding more stuff to the inspector at this point only makes things worse. However there's an effort underway that might fit additional help text and/or links in the inspector: #40204 Perhaps the best part at this point is to omit the link for now, update the documentation to be fresher, and then revisit adding a link to documentation separately, perhaps after 40204 lands? |
+1
+1 A suggestion on copy below but feel free to ignore. "Convert" felt a little too techie to me as the primary CTA. |
4c2fe7f
to
585e356
Compare
I updated the text with @SaxonF's suggestion. Also, there is indeed a WordPress Brand Writing Style Guide! In particular, it recommends the use of American English, so I changed the spelling from 'Organise' to 'Organize.' (@getdave mentioned interest in a style guide like this). Let me know how things look! Am happy to keep iterating. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for being so receptive to feedback and for continuing to iterate here.
I tested this and the wording seems fine to me with the exception of the "tip" (see comment).
) } | ||
</p> | ||
<p> | ||
{ __( | ||
"Note: if you add new pages to your site, you'll need to add them to your navigation menu." | ||
'Tip: If you want to return to a managed menu, simply add a new menu item and pick the Pages List block.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As things stand there doesn't appear to be a way to achieve this. Try it out and you'll see what I mean.
Therefore I don't think we can include this "tip" until we have a new PR which enables this flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this is removed we're good to merge this.
@getdave is right, thanks for testing this. When I try to add a new Page List, the original styling is lost: Even if I try to insert a new Header pattern and start over, I'm unable to recreate the header as it was originally; it utilizes a Navigation block instead of a Page List block: In other words, as it stands, once a Page List block is converted inside of the default header, one is unable to return to the original implementation. Perhaps the text should be revised to the following instead, at least until this can be improved? Or perhaps this is a bug that needs to be addressed, and we should refrain from moving forward on this issue until that is resolved.
|
After additional testing, I realized you can get the original implementation back if you add a new Navigation block to the header: Perhaps the text could be the following then:
|
I would just remove the We can raise an Issue to track the need to be able to revert to a "managed menu" although I suspect it will be a less common use case. |
I agree with @getdave - because the best solution to the problem the tip found is that we should have a one button action somewhere to revert to "managed menu". In other words maybe an attribute of the navigation block that overrides how the fallback performs in the sens that if attribute is true then it always shows and renders a page list block? |
@getdave I was originally thinking about the pages block as basically a setting at the nav level of the sub nav level (e.g. just a toggle) but the issue I ran into was how to handle search, logo etc. There needs to be a "line" between what's managed and what's not, and the pages block is that line at the moment. One potential solution is for the navigation block to focus purely on nav related items. Logo, search etc would just exist at the header level outside the navigation block. |
@artemiomorales Is there anything I can do to help you with landing this one? |
585e356
to
fe07bac
Compare
@getdave I don't believe so! I just updated the branch and removed the tip. Just let me know if I should make any additional changes 🙏 |
What?
Fixes #44615.
This pull request clarifies the copy for the Convert to Links functionality in the Page List block, explaining where the current menu comes from and providing a link to the documentation, as per this issue.
Why?
This will make the functionality clearer to users and cut down on confusion.
How?
It's just a simple update of the copy.
Testing Instructions
Screenshot