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

indigoxela's picture

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.

BWPanda's picture

Can it be somehow put back?

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...

indigoxela's picture

@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

  • Install and enable both modules: File Entity Embed Filter and PDFjs

Go to admin/config/content/formats/filtered_html

  • Enable the widget (pull the icon to the active toolbar)
  • Enable the filter (important)
  • Save

Go to admin/structure/views/view/feef_autocomplete/configure

  • Edit "Filter Criteria" - add Document
  • Save

Go to admin/structure/file-types/manage/document/file-display

  • Select 'PDF.js: Default viewer
  • Save

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.

 

indigoxela's picture

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.