I'm trying to add a userElement to my RTE, but if I click on the icon for userelements (I hope it is the right icon, I never used that before) an empty window opens...
Is there something wrong on my Page TSConfig:
RTE.default.proc.allowTags := addToList(star)
RTE.default.proc.allowTagsOutside := addToList(star)
RTE.default.proc.entryHTMLparser_db.allowTags < RTE.default.proc.allowTags
RTE.default.showButtons = *
RTE.default.hideButtons ()
RTE.default.userElements.10 = Own Tags
// tag configuration
RTE.default.userElements.10.1 = Stars
RTE.default.userElements.10.1.description = The selected text will be wrapped with <star></star>
RTE.default.userElements.10.1.mode = wrap
RTE.default.userElements.10.1.content = <star>|</star>
And the Typoscript:
lib.parseFunc.allowTags := addToList(star)
lib.parseFunc_RTE.allowTags := addToList(star)
Solved the Problem with this Configuration in Page TSConfig:
Edit page > Resources tab
RTE.default {
disableEnterParagraphs = 1
userElements.10 = PDF Optionen
userElements.10 {
6 = Pagebreak
6.description = Manueller Seitenumbruch im PDF
6.mode = wrap
6.content = <div class="pagebreak">|</div>
}
}
RTE.default {
showButtons := addToList(user)
removeTags := removeFromList(user)
proc.HTMLparser_rte.allowTags < RTE.default.proc.allowTags
proc.HTMLparser_db.allowTags < RTE.default.proc.allowTags
proc.entryHTMLparser_db.allowTags < RTE.default.proc.allowTags
}
Related
I have a finished static HTML Template. I need to map it to typo3 so the content is dynamic. I followed following tutorial: https://docs.typo3.org/typo3cms/SitePackageTutorial/FluidTemplates/Index.html
This works perfectly, but now I wonder how I can change the template per site? I made template for each site i.e Gallerie.html, Contact.html and they are linked to the same Layout as Header and Footer is always the same.
How do I now tell the page About us to use the Gallerie.html?
My setup.typoscript:
page = PAGE
page {
typeNum = 0
// Part 1: Fluid template section
10 = FLUIDTEMPLATE
10 {
templateName = TEXT
templateName.stdWrap.cObject = CASE
templateName.stdWrap.cObject {
key.data = pagelayout
pagets__default = TEXT
pagets__default.value = Default
default = TEXT
default.value = Default
}
templateRootPaths {
0 = EXT:eventmanagement/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
partialRootPaths {
0 = EXT:eventmanagement/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
layoutRootPaths {
0 = EXT:eventmanagement/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
levels = 1
includeSpacer = 1
as = mainnavigation
}
}
}
At the Moment it loads the Default.html Template from eventmanagement/Resources/Private/Templates/Page/ on every page. I created now a second Template called Gallerie.html in eventmanagement/Resources/Private/Templates/Page/ how do I add this now to the page Gallerie in the Backend?
I don't know if it's very useful to have for (nearly) every page another template but in general that's possible. Just consider that in the root-line always that template is used that is defined on the current level or - if not existing - that, that is found first while going up the root-line.
For every additional template you've to add a section inside this snippet from above:
templateName.stdWrap.cObject {
key.data = pagelayout
pagets__default = TEXT
pagets__default.value = Default
default = TEXT
default.value = Default
}
So including the option about us the snippet could look like this:
templateName.stdWrap.cObject {
key.data = pagelayout
pagets__default = TEXT
pagets__default.value = Default
default = TEXT
default.value = Default
pagets__aboutus = TEXT
pagets__aboutus.value = AboutUs
aboutus = TEXT
aboutus.value = AboutUs
}
Additional you still have to change the TCA probably to include the options in the drop-down-button.
I'm using Typo3 7.6.10 with Gridelements 7.0.5. I'm trying to wrap the gridelement output with the following code but the wrapping is not working. Both files are loaded. The 2-cols-50-50 element is available in the backend and the static gridelements template is loaded. The content of the gridelement is displayed without the wrap defined in the gridelements.ts file.
I would be happy for every help.
tsconfig.ts
tx_gridelements {
overruleRecords = 1
setup {
2-cols-50-50 {
title = 2-Columns
description = 2-columns contentelement
topLevelLayout = 0
config {
colCount = 2
rowCount = 1
rows {
1 {
columns {
1 {
name = Left
colPos = 11
}
2 {
name = Right
colPos = 12
}
}
}
}
}
}
}
}
gridelements.ts
tt_content.gridelements_pi1.20.10.setup >
tt_content.gridelements_pi1.20.10.setup {
2-cols-50-50 < lib.gridelements.defaultGridSetup
2-cols-50-50 {
columns {
11 < .default
11.wrap = <div class="left">|</div>
12 < .default
12.wrap = <div class="right">|</div>
}
wrap = <div class="well">|</div>
}
}
I found the mistake. The static gridelements template has to be included before the extension template. Otherwise the static template overwrites tt_content.gridelements_pi1.
I am using TYPO3 7.6.4.
In my TSConfig I am using this to add custom styles:
RTE.classes{
highlight{
name = highlight
value = color:#636466; font-size:15px;
}
brown{
name = braun
value = color:#9A3811;
}
}
RTE.default{
ignoreMainStyleOverride = 1
useCSS = 1
showTagFreeClasses = 1
contentCSS = fileadmin/templates/css/rte.css
buttons {
blockstyle.tags.div.allowedClasses := addToList(highlight, brown)
blockstyle.tags.p.allowedClasses := addToList(highlight, brown)
textstyle.tags.span.allowedClasses := addToList(highlight, brown)
}
proc.allowedClasses := addToList(highlight, brown)
}
1) Instead of specifying div, p, span, is there a way to add available classes to all tags?
2) Do I need to have the RTE.classes part if I have made an external RTE style sheet?
ad 1.)
blockstyle.tags.all.allowedClasses should work if I read https://docs.typo3.org/typo3cms/extensions/rtehtmlarea/Configuration/PageTsconfig/interfaceConfiguration/Index.html correctly.
ad 2.)
yes, otherwise RTE will not show you the drop down for selection of the classes
I'm trying to figure out how conditionally add a class to the body tag of a specific page. I'm trying to do it via typoscipt but haven't been able to figure it out. Maybe there's a better way to do it though. The site is using Typo3 version 4.4.6
I've tried this which didn't work
page.4.bodyTag >
page.4.bodyTagCObject = TEXT
page.4.bodyTagCObject {
field = uid
wrap = <body class="uid-|">
}
Any help or pointers would be greatly appreciated!
Figured it out!
[globalVar = TSFE:id = 4]
page.bodyTag = <body class="page-speakers">
[end]
We use the follwing snippet for TYPO3 4.5 and TYPO3 6.2. Outputs class and id like this on every page. Just style your css.
<body id="pid13" class="be- rpid13 level1 no-subs">
Snippet to place into root setup:
page {
bodyTagCObject >
bodyTagCObject = COA
bodyTagCObject {
### id of page in root level:
10 = TEXT
10.data = levelfield:1, uid
10.dataWrap = id="pid{TSFE:id}" class="be-{TSFE:beUserLogin} rpid|
### current level/depth of page
20 = TEXT
20.data = level:1
20.noTrimWrap = | level| |
### if page has subpages
30 = TEXT
30.value = has-subs
30.if.isTrue.numRows {
table = pages
where = pid=this
}
### if page has NO subpages
40 = TEXT
40.value = no-subs
40.if.negate = 1
40.if.isTrue.numRows {
table = pages
where = pid=this
}
50 = TEXT
50.value = "
stdWrap.noTrimWrap = |<body |>|
}
}
Since TYPO3 Version 9:
# Body Classes
[page["uid"] == 1]
page.bodyTag = <body class="home">
[END]
Following will do
page.bodyTag >
page.bodyTagCObject = TEXT
page.bodyTagCObject.value= skin-blue
page.bodyTagCObject.wrap = <body class="|">
I'm usign tt_news for publishing news on sites. I have 3 domains which are using the same news content, and I would like to generate a canonical tags for news which will point to only one (main) domain. I have the following TypoScript, but it generates canonical tags with three different urls.
[globalVar = GP:tx_ttnews|tt_news > 0]
page.headerData.1422 = TEXT
page.headerData.1422 {
typolink.parameter.data = TSFE:id
typolink.forceAbsoluteUrl = 1
typolink.returnLast = url
typolink.additionalParams.cObject = COA
typolink.additionalParams.cObject {
10 = TEXT
10.dataWrap = &tx_ttnews[tt_news]={GP:tx_ttnews|tt_news}
10.if.isTrue.data = GP:tx_ttnews|tt_news
20 = TEXT
20.dataWrap = &tx_ttnews[cat]={GP:tx_ttnews|cat}
20.if.isTrue.data = GP:tx_ttnews|cat
}
wrap = <link href="|" rel="canonical">
}
[END]
Any sugestions?
i would just remove "forceAbsoluteURL" and add the baseUrl in your wrap on your own.
[globalVar = GP:tx_ttnews|tt_news > 0]
page.headerData.1422 = TEXT
page.headerData.1422 {
typolink.parameter.data = TSFE:id
# typolink.forceAbsoluteUrl = 1
typolink.returnLast = url
typolink.additionalParams.cObject = COA
typolink.additionalParams.cObject {
10 = TEXT
10.dataWrap = &tx_ttnews[tt_news]={GP:tx_ttnews|tt_news}
10.if.isTrue.data = GP:tx_ttnews|tt_news
20 = TEXT
20.dataWrap = &tx_ttnews[cat]={GP:tx_ttnews|cat}
20.if.isTrue.data = GP:tx_ttnews|cat
}
wrap = <link href="http://example.com/|" rel="canonical">
}
[END]