All threads / How do I implement my own buttons and functions for Trix
Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I implement my own buttons and functions for Trix

Sebastian asked in Gems / Libraries

Hey, i want to have the possibility to add more functionality in my text editor trix.
I think about basic stuff as centering text etc. and more advanced stuff like post spotify songs or twitter feeds etc. is this possible ?

ha, thats me answering that question.

It's not just the actual buttons, which is ok for simple things - its allowing video/twitter/insta embeds and adding more complex dialogs for links and image insertion.

For dialogs and images, i'd like to be able to send a rails view/partial to provide an image chooser. For the link dialog, customising it to allow choosing from a list of internal links or an input for external. choose open in _blank etc.

there doesnt seem to be much docs for that stuff because the BC crew are focused on using trix for formatting comments & documents in basecamp type of use cases.

thanks for sharing , this will help me

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 66,257+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.