diff --git a/Classes/DataProcessing/DatabaseQueryProcessor.php b/Classes/DataProcessing/DatabaseQueryProcessor.php
index 6ef97268..7bc1cd64 100644
--- a/Classes/DataProcessing/DatabaseQueryProcessor.php
+++ b/Classes/DataProcessing/DatabaseQueryProcessor.php
@@ -37,7 +37,7 @@
* bodytext = TEXT
* bodytext {
* field = bodytext
- * parseFunc =< lib.parseFunc_links
+ * parseFunc =< lib.parseFunc_RTE
* }
* link = TEXT
* link {
diff --git a/Configuration/TypoScript/2.x/ContentElement/Text.typoscript b/Configuration/TypoScript/2.x/ContentElement/Text.typoscript
index 1f64fb10..2e2dd796 100755
--- a/Configuration/TypoScript/2.x/ContentElement/Text.typoscript
+++ b/Configuration/TypoScript/2.x/ContentElement/Text.typoscript
@@ -6,7 +6,7 @@ tt_content.text {
bodytext = TEXT
bodytext {
field = bodytext
- parseFunc =< lib.parseFunc_links
+ parseFunc =< lib.parseFunc_RTE
}
}
}
diff --git a/Configuration/TypoScript/2.x/ContentElement/Textmedia.typoscript b/Configuration/TypoScript/2.x/ContentElement/Textmedia.typoscript
index 869154d4..e8ffc070 100755
--- a/Configuration/TypoScript/2.x/ContentElement/Textmedia.typoscript
+++ b/Configuration/TypoScript/2.x/ContentElement/Textmedia.typoscript
@@ -7,7 +7,7 @@ tt_content.textmedia {
bodytext = TEXT
bodytext {
field = bodytext
- parseFunc =< lib.parseFunc_links
+ parseFunc =< lib.parseFunc_RTE
}
gallery = TEXT
gallery {
diff --git a/Configuration/TypoScript/2.x/ContentElement/Textpic.typoscript b/Configuration/TypoScript/2.x/ContentElement/Textpic.typoscript
index afd759c6..2c4d47b4 100755
--- a/Configuration/TypoScript/2.x/ContentElement/Textpic.typoscript
+++ b/Configuration/TypoScript/2.x/ContentElement/Textpic.typoscript
@@ -7,7 +7,7 @@ tt_content.textpic {
bodytext = TEXT
bodytext {
field = bodytext
- parseFunc =< lib.parseFunc_links
+ parseFunc =< lib.parseFunc_RTE
}
gallery = TEXT
gallery {
diff --git a/Configuration/TypoScript/2.x/Helper/ParseFunc.typoscript b/Configuration/TypoScript/2.x/Helper/ParseFunc.typoscript
index 903b0758..b586825f 100755
--- a/Configuration/TypoScript/2.x/Helper/ParseFunc.typoscript
+++ b/Configuration/TypoScript/2.x/Helper/ParseFunc.typoscript
@@ -6,22 +6,15 @@ lib {
makelinks {
http {
keep = {$styles.content.links.keep}
- extTarget.data = parameters:target
+ extTarget = {$styles.content.links.extTarget}
}
+
mailto {
keep = path
}
}
+
tags {
- link = TEXT
- link {
- current = 1
- typolink {
- parameter.data = parameters : allParams
- extTarget.data = parameters:target
- }
- parseFunc.constants = 1
- }
a = TEXT
a {
current = 1
@@ -29,14 +22,24 @@ lib {
parameter.data = parameters:href
title.data = parameters:title
ATagParams.data = parameters:allParams
- target.data = parameters:target
- extTarget.data = parameters:target
+ # the target attribute takes precedence over config.intTarget
+ target.ifEmpty.data = parameters:target
+ # the target attribute takes precedence over the constant (styles.content.links.extTarget)
+ # which takes precedence over config.extTarget
+ # do not pass extTarget as reference, as it might not be set resulting in the string being
+ # written to the target attribute
+ extTarget {
+ ifEmpty < config.extTarget
+ ifEmpty.override = {$styles.content.links.extTarget}
+ override.data = parameters:target
+ }
}
}
}
+
allowTags = {$styles.content.allowTags}
denyTags = *
- sword = |
+ # @deprecated since TYPO3 v12, remove with v13
constants = 1
nonTypoTagStdWrap {
HTMLparser = 1
@@ -51,19 +54,22 @@ lib {
parseFunc_RTE < lib.parseFunc
parseFunc_RTE {
# Processing
, and blocks separately
- externalBlocks = article, aside, blockquote, div, dd, dl, footer, header, nav, ol, section, table, ul, pre
+ externalBlocks = article, aside, blockquote, div, dd, dl, footer, header, nav, ol, section, table, ul, pre, figure
externalBlocks {
ol {
stripNL = 1
- stdWrap.parseFunc = < lib.parseFunc
+ stdWrap.parseFunc =< lib.parseFunc
}
+
ul {
stripNL = 1
- stdWrap.parseFunc = < lib.parseFunc
+ stdWrap.parseFunc =< lib.parseFunc
}
+
pre {
stdWrap.parseFunc < lib.parseFunc
}
+
table {
stripNL = 1
stdWrap {
@@ -74,25 +80,34 @@ lib {
always = 1
list = contenttable
}
+
keepNonMatchedTags = 1
}
}
+
HTMLtableCells = 1
HTMLtableCells {
# Recursive call to self but without wrapping non-wrapped cell content
default.stdWrap {
- parseFunc = < lib.parseFunc_RTE
- parseFunc.nonTypoTagStdWrap.encapsLines.nonWrappedTag =
+ parseFunc =< lib.parseFunc_RTE
+ parseFunc.nonTypoTagStdWrap.encapsLines {
+ nonWrappedTag =
+ innerStdWrap_all.ifBlank =
+ }
}
+
addChr10BetweenParagraphs = 1
}
}
+
div {
stripNL = 1
callRecursive = 1
}
+
article < .div
aside < .div
+ figure < .div
blockquote < .div
footer < .div
header < .div
@@ -101,20 +116,23 @@ lib {
dl < .div
dd < .div
}
+
nonTypoTagStdWrap {
+ HTMLparser = 1
+ HTMLparser {
+ keepNonMatchedTags = 1
+ htmlSpecialChars = 2
+ }
+
encapsLines {
encapsTagList = p,pre,h1,h2,h3,h4,h5,h6,hr,dt
remapTag.DIV = P
nonWrappedTag = P
innerStdWrap_all.ifBlank =
}
- HTMLparser = 1
- HTMLparser {
- keepNonMatchedTags = 1
- htmlSpecialChars = 2
- }
}
}
+
parseFunc_links {
htmlSanitize = 1
tags {
@@ -141,8 +159,3 @@ lib {
}
}
}
-
-
-
-
-
diff --git a/Configuration/TypoScript/ContentElement/Shortcut.typoscript b/Configuration/TypoScript/ContentElement/Shortcut.typoscript
index c31ceeae..a2ce9577 100755
--- a/Configuration/TypoScript/ContentElement/Shortcut.typoscript
+++ b/Configuration/TypoScript/ContentElement/Shortcut.typoscript
@@ -3,7 +3,7 @@ tt_content.shortcut {
fields {
content {
fields {
- shortcut = COA
+ shortcut =< lib.renderChildren
shortcut {
10 = RECORDS
10 {
@@ -13,27 +13,6 @@ tt_content.shortcut {
{$styles.content.shortcut.tables}.stdWrap.wrap = |###BREAK###
}
}
- stdWrap {
- innerWrap = [|]
- split {
- token = ###BREAK###
- cObjNum = 1 |*|2|*| 3
- 1 {
- current = 1
- stdWrap.wrap = |
- }
-
- 2 {
- current = 1
- stdWrap.wrap = ,|
- }
-
- 3 {
- current = 1
- stdWrap.wrap = |
- }
- }
- }
}
}
}
diff --git a/Configuration/TypoScript/ContentElement/Text.typoscript b/Configuration/TypoScript/ContentElement/Text.typoscript
index 1f64fb10..2e2dd796 100755
--- a/Configuration/TypoScript/ContentElement/Text.typoscript
+++ b/Configuration/TypoScript/ContentElement/Text.typoscript
@@ -6,7 +6,7 @@ tt_content.text {
bodytext = TEXT
bodytext {
field = bodytext
- parseFunc =< lib.parseFunc_links
+ parseFunc =< lib.parseFunc_RTE
}
}
}
diff --git a/Configuration/TypoScript/ContentElement/Textmedia.typoscript b/Configuration/TypoScript/ContentElement/Textmedia.typoscript
index a187c251..98f04102 100755
--- a/Configuration/TypoScript/ContentElement/Textmedia.typoscript
+++ b/Configuration/TypoScript/ContentElement/Textmedia.typoscript
@@ -7,7 +7,7 @@ tt_content.textmedia {
bodytext = TEXT
bodytext {
field = bodytext
- parseFunc =< lib.parseFunc_links
+ parseFunc =< lib.parseFunc_RTE
}
gallery = TEXT
gallery {
diff --git a/Configuration/TypoScript/ContentElement/Textpic.typoscript b/Configuration/TypoScript/ContentElement/Textpic.typoscript
index 2fac0d92..9a95208b 100755
--- a/Configuration/TypoScript/ContentElement/Textpic.typoscript
+++ b/Configuration/TypoScript/ContentElement/Textpic.typoscript
@@ -7,7 +7,7 @@ tt_content.textpic {
bodytext = TEXT
bodytext {
field = bodytext
- parseFunc =< lib.parseFunc_links
+ parseFunc =< lib.parseFunc_RTE
}
gallery = TEXT
gallery {
diff --git a/Configuration/TypoScript/ContentElement/ParseFunc.typoscript b/Configuration/TypoScript/Helpers/ParseFunc.typoscript
similarity index 74%
rename from Configuration/TypoScript/ContentElement/ParseFunc.typoscript
rename to Configuration/TypoScript/Helpers/ParseFunc.typoscript
index 903b0758..b586825f 100755
--- a/Configuration/TypoScript/ContentElement/ParseFunc.typoscript
+++ b/Configuration/TypoScript/Helpers/ParseFunc.typoscript
@@ -6,22 +6,15 @@ lib {
makelinks {
http {
keep = {$styles.content.links.keep}
- extTarget.data = parameters:target
+ extTarget = {$styles.content.links.extTarget}
}
+
mailto {
keep = path
}
}
+
tags {
- link = TEXT
- link {
- current = 1
- typolink {
- parameter.data = parameters : allParams
- extTarget.data = parameters:target
- }
- parseFunc.constants = 1
- }
a = TEXT
a {
current = 1
@@ -29,14 +22,24 @@ lib {
parameter.data = parameters:href
title.data = parameters:title
ATagParams.data = parameters:allParams
- target.data = parameters:target
- extTarget.data = parameters:target
+ # the target attribute takes precedence over config.intTarget
+ target.ifEmpty.data = parameters:target
+ # the target attribute takes precedence over the constant (styles.content.links.extTarget)
+ # which takes precedence over config.extTarget
+ # do not pass extTarget as reference, as it might not be set resulting in the string being
+ # written to the target attribute
+ extTarget {
+ ifEmpty < config.extTarget
+ ifEmpty.override = {$styles.content.links.extTarget}
+ override.data = parameters:target
+ }
}
}
}
+
allowTags = {$styles.content.allowTags}
denyTags = *
- sword = |
+ # @deprecated since TYPO3 v12, remove with v13
constants = 1
nonTypoTagStdWrap {
HTMLparser = 1
@@ -51,19 +54,22 @@ lib {
parseFunc_RTE < lib.parseFunc
parseFunc_RTE {
# Processing , and blocks separately
- externalBlocks = article, aside, blockquote, div, dd, dl, footer, header, nav, ol, section, table, ul, pre
+ externalBlocks = article, aside, blockquote, div, dd, dl, footer, header, nav, ol, section, table, ul, pre, figure
externalBlocks {
ol {
stripNL = 1
- stdWrap.parseFunc = < lib.parseFunc
+ stdWrap.parseFunc =< lib.parseFunc
}
+
ul {
stripNL = 1
- stdWrap.parseFunc = < lib.parseFunc
+ stdWrap.parseFunc =< lib.parseFunc
}
+
pre {
stdWrap.parseFunc < lib.parseFunc
}
+
table {
stripNL = 1
stdWrap {
@@ -74,25 +80,34 @@ lib {
always = 1
list = contenttable
}
+
keepNonMatchedTags = 1
}
}
+
HTMLtableCells = 1
HTMLtableCells {
# Recursive call to self but without wrapping non-wrapped cell content
default.stdWrap {
- parseFunc = < lib.parseFunc_RTE
- parseFunc.nonTypoTagStdWrap.encapsLines.nonWrappedTag =
+ parseFunc =< lib.parseFunc_RTE
+ parseFunc.nonTypoTagStdWrap.encapsLines {
+ nonWrappedTag =
+ innerStdWrap_all.ifBlank =
+ }
}
+
addChr10BetweenParagraphs = 1
}
}
+
div {
stripNL = 1
callRecursive = 1
}
+
article < .div
aside < .div
+ figure < .div
blockquote < .div
footer < .div
header < .div
@@ -101,20 +116,23 @@ lib {
dl < .div
dd < .div
}
+
nonTypoTagStdWrap {
+ HTMLparser = 1
+ HTMLparser {
+ keepNonMatchedTags = 1
+ htmlSpecialChars = 2
+ }
+
encapsLines {
encapsTagList = p,pre,h1,h2,h3,h4,h5,h6,hr,dt
remapTag.DIV = P
nonWrappedTag = P
innerStdWrap_all.ifBlank =
}
- HTMLparser = 1
- HTMLparser {
- keepNonMatchedTags = 1
- htmlSpecialChars = 2
- }
}
}
+
parseFunc_links {
htmlSanitize = 1
tags {
@@ -141,8 +159,3 @@ lib {
}
}
}
-
-
-
-
-
diff --git a/Configuration/TypoScript/Helpers/RenderChildren.typoscript b/Configuration/TypoScript/Helpers/RenderChildren.typoscript
new file mode 100755
index 00000000..2b7ed834
--- /dev/null
+++ b/Configuration/TypoScript/Helpers/RenderChildren.typoscript
@@ -0,0 +1,44 @@
+/**
+* This lib renders children in headless.
+* To use this code copy code below and replace FIELDNAME and TABLENAME with correct values for relation
+*
+children =< lib.renderChildren
+children.10 {
+ source.field = FIELDNAME
+ tables = TABLENAME
+ conf.TABLENAME.stdWrap.wrap = |###BREAK###
+}
+*
+*/
+
+lib.renderChildren = COA
+lib.renderChildren {
+ 10 = RECORDS
+ stdWrap {
+ innerWrap = [|]
+ split {
+ token = ###BREAK###
+ cObjNum = 1 |*|2|*| 3
+ 1 {
+ current = 1
+ stdWrap {
+ wrap = |
+ }
+ }
+
+ 2 {
+ current = 1
+ stdWrap {
+ wrap = ,|
+ }
+ }
+
+ 3 {
+ current = 1
+ stdWrap {
+ wrap = |
+ }
+ }
+ }
+ }
+}
diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript
index cf1e20f0..91c76729 100644
--- a/Configuration/TypoScript/setup.typoscript
+++ b/Configuration/TypoScript/setup.typoscript
@@ -6,6 +6,8 @@ plugin.tx_headless {
## Include page
@import "EXT:headless/Configuration/TypoScript/Page/*.typoscript"
+## Include helpers
+@import "EXT:headless/Configuration/TypoScript/Helpers/*.typoscript"
## Include content elements
@import "EXT:headless/Configuration/TypoScript/ContentElement/*.typoscript"
## Include configuration
diff --git a/Documentation/Developer/Index.rst b/Documentation/Developer/Index.rst
index 3efe9a44..1313e439 100644
--- a/Documentation/Developer/Index.rst
+++ b/Documentation/Developer/Index.rst
@@ -192,7 +192,7 @@ object with a header definition `lib.contentElementWithHeader`:
bodytext = TEXT
bodytext {
field = bodytext
- parseFunc =< lib.parseFunc_links
+ parseFunc =< lib.parseFunc_RTE
}
demoSubfields {
fields {