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

How to clone Trix default link button, so I have modal and insert text into editor? #1174

Open
cimenta opened this issue Jul 28, 2024 · 0 comments

Comments

@cimenta
Copy link

cimenta commented Jul 28, 2024

Hi

I need help because after extensive Google search I did not find any solution.

I would like to add a button to Trix editor that would insert YouTube video using custom HTML attribute. It seems to me that default link button is exactly what I need. I would need to just modify little bit what is done once someone click the link button after text is entered.
enter image description here

The standard link button

  • has Trix menu button
  • has input field
  • has input value validation
  • link and unlink functionality. I might want to remove the unlink button
  • inserts text into editor

I was searching the net but did not find any example how to achieve what I want. The closest solution is https://www.kindleman.com.au/blog/advanced-actiontext-modifications-for-cms-use/ the embed, image, and link buttons are basically what I want. But it is coded in RoR. I know nothing about RoR.

Could someone help me to create my link (embed) button in Trix?

Thank you
Radek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant