trix icon indicating copy to clipboard operation
trix copied to clipboard

Embed IMG instead of upload?

Open yesthatjwz opened this issue 3 years ago • 3 comments

Rather than uploading images, I would like to have a way to add inline IMG tags to the HTML. Ideally, the "attach" button would prompt for a URL instead of a local file. What's the easiest way to accomplish this?

yesthatjwz avatar Apr 23 '22 05:04 yesthatjwz

I have the same doubt, how would it be in this case?

JuanPerdomo00 avatar Apr 24 '22 02:04 JuanPerdomo00

I got it working. Code is here, on my WordPress plugin that replaces the comment field with Trix. If anyone has suggestions of a better way, I'd love to hear it! Dealing with the dialog prompt was difficult and undocumented.

My repurposed "attach" button looks at the URL and does the right thing to embed images, MP4s, or YouTube or Vimeo videos.

I also implemented "dark mode".

yesthatjwz avatar Apr 27 '22 23:04 yesthatjwz

dude, you can achieve this but not with Trix, just use markdown

kwhandy avatar Jul 15 '22 17:07 kwhandy