You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tested out the Insert module described by @BWPanda in his blog post. It works very nicely and, I think, eliminates a lot of the tedium that @quicksketch identifies as a sticking point against Markdown. With the Insert module, to add an image to a Markdown-formatted field, you:
Upload the file.
Put your cursor where you want the image.
Click the "Insert" button.
Presto. The Markdown-formatted image code is in place.
That said, there's a bit of preparation that needs to be done on the site to make this work. First, of course, install and enable the Insert module.
Next, to get Markdown-formatted image code, you need to override the image-insert.tpl.php template in the admin theme. I created a simple sub-theme of Seven ("badmin"), put the overridden template file in its templates folder, and set that to be the admin theme (of my local copy of backdropcms.org) to override the template.
Also, to make this work the image file needs to be a field of the content type. The Page content has a Files field already, and we can enable Insert for that field, and it works, but since there is no provision for entering alt or title text with a generic file, there's no alt or title text in the inserted image HTML.
A cleaner solution is to add an Image field to the Page type and then enable Insert for that field. In this case, everything works exactly as desired.
A difference from using the image widget in CKEditor is that when CKeditor uploads an image, it doesn't attach it to the particular content type; it puts all images in One Big Heap. (Personally, when I'm creating page nodes that have bespoke images embedded within them I prefer to have the images attached to the node they go with, but I realize others might not.)
And I realize that adding another field to content types is not something done lightly, since that field will persist forever and we'll now have images in two different places: some in CKEditor's one big heap, some attached to nodes (although that is maybe already the case).
All things considered, though, I think adding the Insert module removes one of the last arguments against Markdown, so I would vote for adding both Markdown and Insert to achieve the least-friction way of adding further content to the *.b.org sites.
And on the image issue, I don't think we should add another field to every place that uses the markdown filter. Fortunately, we have another work-around already [upload the image as a file attached to the node using the existin Files field].
The text was updated successfully, but these errors were encountered:
Next, to get Markdown-formatted image code, you need to override the image-insert.tpl.php template in the admin theme. I created a simple sub-theme of Seven ("badmin"), put the overridden template file in its templates folder, and set that to be the admin theme (of my local copy of backdropcms.org) to override the template.
What happens when you use insert module with one of the other text formats? Does it still insert the image properly, or does the markdown formatting make that not work properly?
bugfolder
changed the title
Add Insert module to simply using images with Markdown filter
Add Insert module to simplify using images with Markdown filter
Apr 3, 2022
What happens when you use insert module with one of the other text formats? Does it still insert the image properly, or does the markdown formatting make that not work properly?
It inserts both Markdown and HTML versions, so one or the other (or both) work, and you just delete the line that's not applicable. Works with CKEditor, too.
This is a follow-up to #796 (comment) and #796 (comment). Copying the description from the latter:
I've tested out the Insert module described by @BWPanda in his blog post. It works very nicely and, I think, eliminates a lot of the tedium that @quicksketch identifies as a sticking point against Markdown. With the Insert module, to add an image to a Markdown-formatted field, you:
That said, there's a bit of preparation that needs to be done on the site to make this work. First, of course, install and enable the Insert module.
Next, to get Markdown-formatted image code, you need to override the image-insert.tpl.php template in the admin theme. I created a simple sub-theme of Seven ("badmin"), put the overridden template file in its templates folder, and set that to be the admin theme (of my local copy of backdropcms.org) to override the template.
Also, to make this work the image file needs to be a field of the content type. The Page content has a Files field already, and we can enable Insert for that field, and it works, but since there is no provision for entering alt or title text with a generic file, there's no alt or title text in the inserted image HTML.
A cleaner solution is to add an Image field to the Page type and then enable Insert for that field. In this case, everything works exactly as desired.
A difference from using the image widget in CKEditor is that when CKeditor uploads an image, it doesn't attach it to the particular content type; it puts all images in One Big Heap. (Personally, when I'm creating page nodes that have bespoke images embedded within them I prefer to have the images attached to the node they go with, but I realize others might not.)
And I realize that adding another field to content types is not something done lightly, since that field will persist forever and we'll now have images in two different places: some in CKEditor's one big heap, some attached to nodes (although that is maybe already the case).
All things considered, though, I think adding the Insert module removes one of the last arguments against Markdown, so I would vote for adding both Markdown and Insert to achieve the least-friction way of adding further content to the *.b.org sites.
@jenlampton noted in #796 (comment),
The text was updated successfully, but these errors were encountered: