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

Allow inline links in Notice content #13463

Open
danielbachhuber opened this issue Jan 24, 2019 · 4 comments
Open

Allow inline links in Notice content #13463

danielbachhuber opened this issue Jan 24, 2019 · 4 comments
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Package] Notices /packages/notices [Type] Enhancement A suggestion for improvement.

Comments

@danielbachhuber
Copy link
Member

We have an existing admin notice in the Classic Editor that has both a button (action) and link (documentation reference):

image

With the Block Editor Notices API, it's only possible to represent both of these as actions:

image

Ideally, it'd be possible to include inline links for informational content, and keep actions for their semantic purpose.

@danielbachhuber danielbachhuber added [Type] Enhancement A suggestion for improvement. [Package] Notices /packages/notices labels Jan 24, 2019
@danielbachhuber
Copy link
Member Author

Related #13116. It'd be nice to make "Convert" a button again.

@danielbachhuber danielbachhuber added the [Feature] Extensibility The ability to extend blocks or the editing experience label Jan 24, 2019
@nerrad
Copy link
Contributor

nerrad commented Feb 14, 2019

I think I've read/seen somewhere that there's some intention behind making the notices opinionated to keep the design consistent wherever they are used. However I 100% agree that we need some way of implementing inline links.

I wonder if one possible solution here would be to allow notice content to contain whitelisted components specific to a notice. So something like this could be used:

const inlineLink = <NoticeLink href="https://linky.com">with linked text</NoticeLink>;
const noticeContent = <Fragment>
	<NoticeParagraph>
		My success notice { inlineLink }
	</NoticeParagraph>
	<NoticeParagraph>
		Some additional content here.
	</NoticeParagraph>
</Fragment>
wp.data.dispatch( 'core/notices' ).createSuccessNotice( noticeContent );

Upside to this approach is a white-listed set of allowed components gives greater flexibility for the content. One downside however is localizing the content (when it's across multiple components like the given example).

@paaljoachim
Copy link
Contributor

Could we get an update on this issue?
Thanks.

@talldan @youknowriad

@talldan
Copy link
Contributor

talldan commented Feb 11, 2021

This still isn't possible. IIRC this is for security reasons.

Links would be nice to have, but I think this is very low priority because it's fairly complex to solve and something that can be worked around by implementors.

If this issue is still open with no activity the next time someone checks it, we should consider closing as stale/not implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Package] Notices /packages/notices [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants