Skip to content

Commit

Permalink
Add XPATH TypoTag for ckeditor in TYPO3 8.7; modify documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
metacontext committed Jul 9, 2017
1 parent bbebdb7 commit 5b83125
Show file tree
Hide file tree
Showing 11 changed files with 758 additions and 95 deletions.
20 changes: 20 additions & 0 deletions Configuration/RTE/Base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Add configuration for the editor for any configuration
# For complete documentation see http://docs.ckeditor.com/#!/api/CKEDITOR.config
editor:
config:
# the CSS file to be used inside the editor
contentsCss: "EXT:cobj_xpath/Resources/Public/Css/contents.css"
# will be overridden by the record (if a language is set)
defaultContentLanguage: "en"
defaultLanguage: "en"
# Allow any class or any data attribute in any tag
extraAllowedContent: "*(*)[data-*]"
height: 300
width: "auto"
toolbar: "Basic"
uiColor: "#F8F8F8"
removeDialogTabs: "image:advanced;link:advanced"
# Ensure that special characters are not converted to HTML entities
entities_latin: false
entities: false
stylesSet: []
41 changes: 41 additions & 0 deletions Configuration/RTE/Default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Load default processing options
imports:
- { resource: "EXT:cobj_xpath/Configuration/RTE/Processing.yaml" }
- { resource: "EXT:cobj_xpath/Configuration/RTE/Base.yaml" }
- { resource: "EXT:cobj_xpath/Configuration/RTE/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 ] }
- { name: document, groups: [ mode ] }

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

extraPlugins:
- justify

removePlugins:
- image

removeButtons:
- Anchor
- Underline
- Strike
- Styles
8 changes: 8 additions & 0 deletions Configuration/RTE/Plugins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Register custom plugins for ckeditor
# an example is the link plugin to select TYPO3-related links
editor:
externalPlugins:
typo3link: { resource: "EXT:rte_ckeditor/Resources/Public/JavaScript/Plugins/typo3link.js", route: "rteckeditor_wizard_browse_links" }
# This is a plugin, found here: https://github.com/ufdada/quicktable
quicktable: { resource: "EXT:rte_ckeditor/Resources/Public/JavaScript/Plugins/quicktable/plugin.js" }
xpath: { resource: "EXT:cobj_xpath/Resources/Public/JavaScript/Plugins/xpath/plugin.js" }
96 changes: 96 additions & 0 deletions Configuration/RTE/Processing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# ****************************************************
# Sets the proc options for all default configurations
# ****************************************************

processing:
# previously known as "ts_css" for transformations
mode: default
# Tags that are allowed in the content in general
allowTags:
- a
- abbr
- acronym
- address
- article
- big
- blockquote
- br
- caption
- cite
- code
- col
- colgroup
- dd
- del
- dfn
- dl
- div
- dt
- em
- footer
- header
- h1
- h2
- h3
- h4
- h5
- h6
- hr
- i
- img
- ins
- kbd
- label
- li
- nav
- ol
- p
- pre
- q
- samp
- section
- small
- span
- strong
- style
- sub
- sup
- table
- thead
- tbody
- tfoot
- td
- th
- tr
- tt
- ul
- var
- xpath

## Tags that are allowed outside of paragraphs
allowTagsOutside: [address, article, aside, blockquote, footer, header, hr, nav, section, div, xpath]

## allowed default attributes
allowAttributes: [class, id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop]

## CONTENT TO DATABASE
HTMLparser_db:
## STRIP ALL ATTRIBUTES FROM THESE TAGS
## If this list of tags is not set, it will default to: b,i,u,br,center,hr,sub,sup,strong,em,li,ul,ol,blockquote,strike.
## However, we want to keep xml:lang attribute on most tags and tags from the default list were cleaned on entry.
noAttrib: br
# Can be disabled if you trust ckeditor (If Automatic Content Formatting is enabled, this should be OK)
# allowTags: %default%
denyTags: img
allowTags: [xpath]
tags:
hr:
allowedAttribs:
- class

## REMOVE OPEN OFFICE META DATA TAGS, WORD 2003 TAGS, LINK, META, STYLE AND TITLE TAGS, AND DEPRECATED HTML TAGS
## We use this rule instead of the denyTags rule so that we can protect custom tags without protecting these unwanted tags.
removeTags: [center, font, link, meta, o:p, sdfield, strike, style, title, u]

## PROTECT CUSTOM TAGS
keepNonMatchedTags: protect
Binary file added Documentation/Images/manual_html_ckeditor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5b83125

Please sign in to comment.