-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
is it possible to add Custom attribute in link? #10226
Comments
Hey @nitishkaila, |
Hi @Soean, I haven't used a custom block for that. I need to add a custom attribute in the link for core/paragraph and core/list block. is there any hook or possibility to add a custom attribute in the link for existing core block? |
there should be an easy way to add valid html attributes to links which would improve accessibility, usability and security. https://www.w3schools.com/tags/tag_a.asp this could be included [in the link options dialog?] to make adding valid links easier without using the code-mode or additional content filters:
parsing/filtering the_content() leads to performance/maintenance issues as it adds one more function that should be taken care of on entry, [without a developer needed to create custom filters for a client]. these options are basic options available in CKEditor : feature request?these options should be native on any legit cms. |
Hi @encipherdesign, This is CKEditor but I need to add attribute in the Gutenberg link. I have also concern about link click event. Many site has track the google event when click on the link. So I think this is limitation of Gutenberg link which we not add other attribute or not track the click event. |
Hi @Soean All most site has used google analytics event by clicking on button or link. We can embed this think underneath link box. So normal user can easily add the google tracking event or something else without help of developer. thanks |
Attributes is something very developper related, I don't think we should expose any attribute without explanation. For example we don't say "target" we say "open in a new tab". That said, it is still possible to add any custom attribute to link by switching back and forth to the HTML mode of the block. It is also possible to build custom toolbar buttons to allow advanced use-cases using the Format API. I'm closing this for now. Thanks for your input. |
Currently Gutenberg is not providing any type of functionality to add custom html attribute into the link/anchor tag. Also not option to track click event for current flow.
The text was updated successfully, but these errors were encountered: