Questions tagged [trix]

Trix is a WYSIWYG editor for writing messages, comments, articles, and lists—the simple documents most web apps are made of. It features a sophisticated document model, support for embedded attachments, and outputs terse and consistent HTML.

Most WYSIWYG editors are wrappers around HTML’s contenteditable and execCommand APIs, designed by Microsoft to support live editing of web pages in Internet Explorer 5.5, and eventually reverse-engineered and copied by other browsers.

Because these APIs were never fully specified or documented, and because WYSIWYG HTML editors are enormous in scope, each browser’s implementation has its own set of bugs and quirks, and JavaScript developers are left to resolve the inconsistencies.

Trix sidesteps these inconsistencies by treating contenteditable as an I/O device: when input makes its way to the editor, Trix converts that input into an editing operation on its internal document model, then re-renders that document back into the editor. This gives Trix complete control over what happens after every keystroke, and avoids the need to use execCommand at all.

Resources

https://trix-editor.org/

https://github.com/basecamp/trix

175 questions
3
votes
1 answer

Can you edit static HTML content in Directus like you would in a traditional CMS?

I plan to use Directus as a database wrapper to add some CMS functionalities in my site. I can also use Directus to manage images of my site. However to edit some of the static HTML content, can I also use either Directus or some extensions of it? I…
3
votes
0 answers

How to persist custom attributes with Rails 6 ActionText

Ruby 2.6.3 / Rails version 6.0.0 Hello ! I implemented ActionText (using Trix editor) in my rails 6 application, where I use elements with custom tags and attributes like: My Word I found a way to…
Lori
  • 31
  • 1
3
votes
2 answers

Trix Editor Rails - Customizing

I am using a trix editor such as <%= f.trix_editor :body, class: 'trix-content form-control', rows: 15 %> Currently the buttons are black and obviously translated english (as well as the alt texts). How am I supposed to change the colors of the…
benl96
  • 274
  • 3
  • 18
3
votes
3 answers

Trix WYSIWYG Editor change default rows/vertical height of textfield

I read through the Trix documentation and an answer did not jump out at me for this. It appears that the Trix WYSIWYG editor defaults to 3 displayed rows: Any chance this can be toggled to more rows, for example: 15 or so rows:
Neil
  • 4,578
  • 14
  • 70
  • 155
2
votes
2 answers

Rails 7 - rich text not showing attached media content

I'm working on a Rails 7 app in which I use ActionText/Trix editor. I'm using Amazon AWS / S3 for storing files. I have verified and can see that media files gets uploaded to S3, but for some reason they don't gets shown (neither in the editor when…
Anders
  • 2,903
  • 7
  • 58
  • 114
2
votes
0 answers

Add class TextEditorField EasyAdmin 4

is there a way to add a custom class to a specific tag with the TextEditorField - EasyAdmin : https://symfony.com/bundles/EasyAdminBundle/current/fields/TextEditorField.html This field is using trix editor : https://trix-editor.org I'd like to do…
Randy Arnold
  • 143
  • 7
2
votes
0 answers

Action Text [Rails 7 Error] vanishing field

Trying to isolate an error I'm getting with the basic setup of a new blog site using the below just so I can test Action_Text for the create blog section. Every-time i create the below- it works great until i change the <%= form.text_area :content…
Karl
  • 21
  • 3
2
votes
0 answers

Add Attributes to ActionText / Trix Attachment

When adding an attachment to my editor I want to add attributes. The core editor does something similar with Image attachments where you can add Captions. How can I add the attributes? How Can I access them when rendering the attachment in the…
Will
  • 4,498
  • 2
  • 38
  • 65
2
votes
0 answers

Customise the defaults on Rails ActionText Trix Editor

Is there anyway of changing the defaults on the Trix editor? For example; I might not need the undo and redo. Currently facing an issue where i'm wanting to change the default Rails ActionText (Trix) editor. I've found resources online for adding a…
2
votes
1 answer

ROR action-text. How to add text-align options to trix rich-text editor?

Im working on a project in ruby on rails (rails 6), that include a blog working with action-text and trix. I have to add few option to my rich-text editor and there is one that block me for few days. I added buttons in my trix toolbar, for add more…
Joachim
  • 111
  • 8
2
votes
3 answers

Action text (Trix) : cannot add images in rich text on Rails ("attach files" not saved)

I am adding a blog to my Rails 6.0 website. I have installed Action Text and linked Active Storage to Cloudinary Then I created a Article model which has a photo. class Article < ApplicationRecord has_one_attached :photo has_rich_text…
GregB
  • 21
  • 4
2
votes
1 answer

Embedding variable inside text using Trix

I would like to let users use variable name inside text box with Trix. Given a trix text-box that let the user write messages to other user, I would like to be able to do something like this: "Hello %user_name%" When sending the message the…
Yann
  • 43
  • 1
  • 5
2
votes
0 answers

Unable to install 'Trix' in an existing app

I've spent some time on trying to add function of uploading, posting and displaying images in my application. I've tried different methods, eventually finding out that 'Trix' is what I need to reach that goal. The issue here is that my application…
2
votes
2 answers

Rails: Trix editor showing image and image size when caption is not specified

I am working on a Rails 6 application with Ubuntu 18. I just installed ActionText for the Trix Editor (what you see is what you get), so that I can save text to the database which can be modified by an admin, however, when I add an image using the…
Promise Preston
  • 24,334
  • 12
  • 145
  • 143
2
votes
2 answers

Trix using rails actiontext add pure html

I would like to use the rich text editor trix in rails6. How can I add a button to trix which adds html content?
Chris
  • 318
  • 1
  • 15
1 2
3
11 12