How to change extra dropdown for link change trait
Create a custom trait: https://grapesjs.com/docs/modules/Traits.html
Read full answer below βQuestion
Hello @artf , I want to give one more functionality to user like user can change any link with default links drop down. In above image i want to add one more dropdown for the default links. If user will select the links from the drop-down then also need to change href of selected link and on other hand if user will type link into href input text-box(marked in above image) then also need to change the href of selected links. How can i do this things can you please help me?
Answers (3)
Create a custom trait: https://grapesjs.com/docs/modules/Traits.html
Hello @artf If i only want to do in change trait for href(<a ) tag then how can i change that? I tried like, But this is something like not works. Can you please help me at where i am doing wrong?
And one more question, how can i check the selected DOM element's type?
I guess it will use isComponent function. But i don't know how to use it and where?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1294
How to add category for default block manager?
@artf I want put all default blocks to category named "Basic". But I can't find any documents about it. I use editor.BlockManager.getAll()....
Issue #1398
GrapesJS translate
Hello @artf , Do I want to translate all functions into Hungarian, so that I can do it? Please give me examples of how to modify these text...
Issue #1926
[QUESTIONS] Edit Placeholder on keyup in Trait
How so that Placeholders can change when typing a word in the trait directly, current placeholders can change only when mouseover I have a...
Issue #457
Two Quick Questions
Hi @artf 1) I have my editor templates like this : I want to change the alignment and also add a back button to the corner left like this o...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βRelated tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.