Hello, In Drupal 7 used IMCE with "iframe" button in Ckeditor to place embedded content such PDF's directly into website. It was easy enough to teach the clients, but in Backdrop there is missing iframe button in Ckeditor. Maybe I am just missing something or need to install a module not sure.
I solved it temporary by uploading via "image" button and placing the resulted route into <iframe> tag manually, but that would be impossible for a non-coder to do (such as clients are).
Any ideas how to solve this? Do I just need to install some kind of module?
Thanks in advance.
Comments
You'll need a module for this I believe. One option is my https://github.com/backdrop-contrib/oembed contrib module, but this is using an out-dated plugin/system, so there may be issues with it... Not sure if/what other options there are.
If it's not a hard requirement to do it through the CKEditor, I would recommend creating a file field that accepts PDF files, and using the PDF.js field formatter:
Hi lubwn,
very likely not exactly what you're searching for, but there's a module to embed file types known to Backdrop via File Entity Embed Filter.
Per default it works for Video and Audio, but can be extended via UI to also work for Documents.
You'd need to adapt the view filter setting (on admin/structure/views/view/feef_autocomplete) for the auto-completion of the CKEditor widget, and to adapt the view mode of your Document file type (on admin/structure/file-types/manage/document/display). Probably you'd also need to adapt the template for Document files (file.tpl.php).
Probably @laryn's suggestion is easier.
Hey, thank you for suggestions. I am currently doing it by hand but I do not understand why simple iframe button is not available in ckeditor. Can it be somehow put back?
Creating a file field for such a purposes is fine but not when I only need it occasionally or only once or twice, also creating file field would make the file tied to content type which I do not want.
I thought there would be an easy solution to this.
Likely yes, though it'll need to be a custom/contrib module. There may be other modules that implement extra CKEditor features that you can look to for inspiration...
@lubwn you can combine the File Entity Embed Filter with the PDF.js module. Then you need no code changes at all, everything is feasible via user interface.
The first setup takes some steps:
Go to admin/modules/install
Go to admin/config/content/formats/filtered_html
Go to admin/structure/views/view/feef_autocomplete/configure
Go to admin/structure/file-types/manage/document/file-display
Upload a PDF (for instance via file/add)
Create (or edit) content, for instance node/add/page
Open the widget dialog by clicking on the editor toolbar icon, start typing your filename
Insert the placeholder into content (like:
[file-embed:26]
)Save the node
In case, the pdf iframe doesn't show up yet, flush caches
Tadaa! Your pdf in the middle of content in your page.
If it has to be the CKEditor iframe plugin, you might need to create a custom module and implement hook_ckeditor_plugins().
There are some extending modules on GitHub that might work as example for your custom module.
If that's no option, you might want to start a port request in this issue queue.