1
votes

I try to add the possibility to allow iframe inside TYPO3 RTE CKEditor. I got to the point where the markup didn't get killed immediately by CKEditor nor by TYPO3s DB parser.

But CKEditor always wraps a p-tag around the iframe which is obviously not correct. I've searched everywhere, tried different settings or combinations of them with no success.

As soon as I add iframe code (doesn't matter if directly in source code mode or via iframe plugin) it gets immediately wrapped inside p-tags. So it is definitely no parsing error within TYPO3 as this happens all within the editor itself.

Any suggestions? Here my current YAML-config for the RTE.

# Load default processing options
imports:
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }

# Add configuration for the editor
# For complete documentation see http://docs.ckeditor.com/#!/api/CKEDITOR.config
editor:
  config:

    format_tags: "p;h1;h2;h3;h4;h5;pre"

    toolbarGroups:
      - { name: styles, groups: [ styles, format ] }
      - { name: basicstyles, groups: [ basicstyles ] }
      - { name: paragraph, groups: [ list, indent, blocks, align ] }
      - { name: links, groups: [ links ] }
      - { name: clipboard, groups: [ clipboard, cleanup, undo ] }
      - { name: editing, groups: [ spellchecker ] }
      - { name: insert, groups: [ insert ] }
      - { name: tools, groups: [ table, specialchar, insertcharacters ] }
      - { name: document, groups: [ mode ] }

    justifyClasses:
      - text-left
      - text-center
      - text-right
      - text-justify

    extraPlugins:
      - justify
      - autolink

    removePlugins:
      - image

    removeButtons:
      - Anchor
      - Underline
      - Strike
      - Styles

    allowTags:
      - iframe

    allowTagsOutside:
      - iframe

    extraAllowedContent:
      - 'iframe(*){*}[*];'

processing:
  allowTags:
    - iframe

  allowTagsOutside:
    - iframe
1

1 Answers

1
votes

i think your problem is that your old config in the rte.ts is still loaded. i added this to my default.yaml:

editor:
    processing:
        allowTags:
            - s
            - span
            - iframe
            - i
    HTMLparser_db:
        tags:
        span:
        rmTagIfNoAttrib: false

config:

    allowedContent: true
    removeFormatAttributes: ""

    extraAllowedContent:
        - span
        - iframe

and added this to my page.ts

RTE.default.proc.blockElementList = PRE,UL,OL,H1,H2,H3,H4,H5,H6,ADDRESS,DL,DD,HEADER,SECTION,FOOTER,NAV,ARTICLE,ASIDE,IFRAME

Hope this helps you