Content isn't visible on the website but it's added in ACP - typo3

I'm new to TYPO3. I came across a small problem - I've added content blocks in ACP (=admin control panel) but they're not visible live.
web_layout.tsconfig:
yellow {
config {
backend_layout {
colCount = 2
rowCount = 3
rows {
1 {
columns {
1 {
colPos = 0
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.0
}
2 {
colPos = 1
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.1
}
}
}
2 {
columns {
3 {
colPos = 2
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.2
}
4 {
colPos = 3
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.3
}
}
}
3 {
columns {
5 {
colPos = 4
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.4
}
6 {
colPos = 5
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.5
}
}
}
}
}
}
title = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow
}
I need to make them visible. As you can see in my web_layout.tsconfig I have 2 columns and 3 rows but on the website there is visible only first row and first column - without the rest of them.
Where should I change config to allow/show TYPO3 that I want to display all 2 columns and 3 rows?

If you create a backend layout you have not changed the rendering for the frontend.
For the frontent you need to adapt the rendering. best way would be to change it depending on selected backend layout.
Therefore you need to copy the given FLUID templates (Layouts/ Templates/ Partials) into your own extension, modify them and add them to the paths.
More information can be found in the manual

Related

TYPO3 How to overwrite blog extension in custom extension

I tried this, in my extension's setup.typoscript. but is not work for me.
plugin.tx_blog {
view {
layoutRootPaths = EXT:solution/Resources/Private/Extensions/Blog/Layouts/
partialRootPaths = EXT:solution/Resources/Private/Extensions/Blog/Partials/
templateRootPaths = EXT:solution/Resources/Private/Extensions/Blog/Templates/
}
}
all the "RootPaths" are arrays so change it to somting like this
plugin.tx_blog {
view {
layoutRootPaths.200 = EXT:solution/Resources/Private/Extensions/Blog/Layouts/
partialRootPaths.200 = EXT:solution/Resources/Private/Extensions/Blog/Partials/
templateRootPaths.200 = EXT:solution/Resources/Private/Extensions/Blog/Templates/
}
the "200" in the examle is the position if Fluid is looking for a Resource (like a template) it will check every provided path in numerical order.
use the Typoscript Object Browser (in the Template Module) to check the configured RootPaths
The standard setup of that extension is a bit uncommon.
The easiest was to override the paths for fluid files is to use the constant editor. There you have fields where you can enter your own paths.
If you want to do it in the setup, you can look in the TypoScript setup of the extension that looks like shown below.
page = PAGE
page {
typeNum = 0
10 = FLUIDTEMPLATE
10 {
templateName = BlogList
templateRootPaths {
0 = EXT:blog/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
partialRootPaths {
0 = EXT:blog/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
layoutRootPaths {
0 = EXT:blog/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
...
So in a short block the the paths would look like this:
page.10.templateRootPaths {
0 = EXT:blog/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
page.10.partialRootPaths {
0 = EXT:blog/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
page.10.layoutRootPaths {
0 = EXT:blog/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
In the lines starting with 1 you can enter your own path if you never want to use the constants. For this you never have to enter it in the original TypoScript template, but just copy the block above in your own TypoScript and adjust the paths. If your TypoScript is loaded after that of the blog, it's overwriting the original values.
Take care that there exist different setups, one in each folder inside https://github.com/TYPO3GmbH/blog/tree/master/Configuration/TypoScript. So depending on the template you chose the setup must be different. But I hope you're able to adapt the way to go now.

TYPO3 v10: rowCount in backend layout seems not to work anymore

I have an issue regarding the backend layouts in TYPO3 10 LTS. In v9 I was able to hide rows in the backend by setting the rowCount to a smaller number than there are rows. I used this to hide the irre-elements for the users. In v10 all rows are shown, no matter which number I set the rowCount. Is this a bug by the new version or am I missing something?
Here is my code:
title = Default
config {
backend_layout {
colCount = 1
rowCount = 1
rows {
1 {
columns {
1 {
name = content
colPos = 0
}
}
}
2 {
columns {
1 {
name = elements from elements (should not be visible)
colPos = 123
}
}
}
}
}
}
}
Thanks in advance
If this ever worked, this was a bug, that has been fixed now. Actually the rowCount and colCount parameters were meant to define a specific number of rows for the backend layout wizard, so that you can set things like rowSpan and colSpan.
The number of visible rows should always have been determined by the actual rows defined in the configuration. If you want to remove columns this should be done with colPos_list: https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/PageTsconfig/Mod.html

TYPO3 8.7.8 restrict available content-elements in backend-layout column

I've been searching over and over but yet haven't found something that would work...
TYPO3 8.7.8
root - backend-layout ("Main") for this and all subpages (id=1)
|
- home - backend-layout ("Home") for this page only (id=2)
|
- subpage - same backend-layout as root (id=3)
both backend-layouts look the same:
________________________________
| Top |
|______________________________|
| main-content | right-content |
|______________|_______________|
The top-section is named differently and to be used differently.
The top-section of the "Main"-backend-layout should have only allowed the images-content-element.
cType.allowed = image
The top-section of the "Home"-backend-layout should have only allowed the text-content-element
cType.allowed = text
The last two things I've tried is
first: restricting it using the GlobalVars in typoscript
[globalVar = TSFE:id != 2]&&[globalVar = TSFE:colPos=2]
TCEFORM.tt_content.CType.removeItems := addToList(header,text,bullets,table,uploads,multimedia,mailform,search,login,splash,menu,shortcut,list,script,div,html,media)
TCEFORM.tt_content.CType.keepItems := addToList(image)
[end]
second: changing the properties of the layout in the database
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Parallax
colspan = 2
colPos = 2
# The following 3 lines have been added through me
cType {
allowed = text
}
}
}
}
2 {
columns {
1 {
name = Content-Main
colPos = 0
}
2 {
name = Content-Right
colPos = 1
}
}
}
}
}
I've tried quite a few other things and I'm not sure if I would find them again. I'm not even sure this can be done in TYPO3 8.x. The options from creating a backend-layout in typo are really restricted. You can only type a name for the column and define the colPos.
Did I do something wrong for TYPO3 8.x that my configurations didn't work?
Do I need different properties? Or is it just not intended to work this way anymore in this version of TYPO3? Because it seems that it has worked before...
I'm still quite a novice to TYPO3 and I would really appreciate your help but be specific on where to change what because otherwise I'll be lost again.... ^^
Thanks!
Thanks to Joey I found the extension to work with: Content Defender
And I found out how to add my backend_layouts through ts; Add the following to the PageTS of the root page
mod.web_layout.BackendLayouts {
Home {
title = Home
config {
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Parallax
colspan = 2
colPos = 2
# allowed and disallowed only work through the extension content_defender (or gridelements)
allowed {
CType = gi_customstyler_parallax_content
}
}
}
}
2 {
columns {
1 {
name = Main
colPos = 0
disallowed {
CType = gi_customstyler_bg_image,gi_customstyler_parallax_content
}
}
2 {
name = Right
colPos = 1
disallowed {
CType = gi_customstyler_bg_image,gi_customstyler_parallax_content
}
}
}
}
}
}
}
}
Main {
title = Main
config {
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Titel-Hintergrund
colspan = 2
colPos = 2
allowed {
CType = gi_customstyler_bg_image
}
}
}
}
2 {
columns {
1 {
name = Main
colPos = 0
disallowed {
CType = gi_customstyler_bg_image,gi_customstyler_parallax_content
}
}
2 {
name = Right
colPos = 1
disallowed {
CType = gi_customstyler_bg_image,gi_customstyler_parallax_content
}
}
}
}
}
}
}
}
}
This way the two backend_layouts are available on the page-configurations with the additional conditions of restricted content-elements. As you can see, this can also be used with custom content-elements.
It took quite a while for me to figure this out (as novice) and I hope that this might help someone else...
Try something like this :
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Parallax
colspan = 2
colPos = 2
allowed = text
}
}
}
2 {
columns {
1 {
name = Content-Main
colPos = 0
}
2 {
name = Content-Right
colPos = 1
}
}
}
}
}
You are on the good way, but the condition is not correct.
Prolbem one: There is no TSFE available for the BE.
In the "globalString" condition, key "TSFE:" will not work because the
TSFE global object only exists in the FE context. The "LIT:" key will
not work either as it is used to compare TypoScript constants, which
are not available in the BE context.
Reference: https://docs.typo3.org/typo3cms/TSconfigReference/Conditions/Index.html
You need to use the "page" instead of the "TSFE:page|". These are equal, but "page" can be used for both frontend and backend but "TSFE" is only for frontend.
The second problem is, that for the colPos you need to access the GP (GetPost) helper instead of the TSFE.
So try to change the condition like this:
[page|uid != 2]&&[globalVar = GP:colPos==2]
TCEFORM.tt_content.CType.removeItems := addToList(header,text,bullets,table,uploads,multimedia,mailform,search,login,splash,menu,shortcut,list,script,div,html,media)
TCEFORM.tt_content.CType.keepItems := addToList(image)
[end]
Note: there is no CType restriction for the BE layouts, so both "cType" and "allowed" are wrong.

TYPO3 Gridelement nesting not working

I've created a extension based on bootstrap_grids, but cannot nest the grid elements. I understand that "allowed = *" should do the job, but the ce don't show up in nested elements.
tx_gridelements {
setup {
section {
title = LLL:EXT:h_grid/Resources/Private/Language/locallang_db.xlf:section.title
description = LLL:EXT:h_grid/Resources/Private/Language/locallang_db.xlf:section.description
icon = EXT:h_grid/Resources/Public/Icons/gridlayout_section.gif
frame = 3
topLevelLayout = 0
config {
colCount = 1
rowCount = 1
rows.1 {
columns {
1 {
name = LLL:EXT:h_grid/Resources/Private/Language/locallang_db.xlf:celayout.leftColumn
colPos = 101
allowed = *
allowedGridTypes = *
}
}
}
}
}
....
Did I miss something?
Try leaving out the lines
allowed = *
allowedGridTypes = *
when you're not actually excluding any elements.

typoscript issue with LOAD_REGISTER and if condition to fill a list

What I'm trying to do is quite complex and an Extbase extension is involved...
Step by step, what I'm trying to do:
An Extbase plugin decides, if certain navigation elements should be marked.
This plugin has one action for each navigation element.
The returned value (0 or 1) from each action in TS is stored on the stack (LOAD_REGISTER).
A list of page UIDs is build by checking against the stored values (0,1).
The navigation COA is modified using this list of page UIDs.
Here is the typoscript code I'm using:
// load information, if pages lack info, into register
10 = LOAD_REGISTER
10 {
lacksAnfahrt {
cObject = USER_INT
cObject {
userFunc = tx_extbase_core_bootstrap->run
pluginName = Pa_klinik_data_edit
extensionName = Hplusinfo
controller = SpitalInfoPA
switchableControllerActions {
SpitalInfoPA {
1 = completeAnfahrt
}
}
}
}
lacksAktivitaeten < .lacksAnfahrt
lacksAktivitaeten.cObject.switchableControllerActions.SpitalInfoPA.1 = completeAktivitaeten
lacksBildergalerie < .lacksAnfahrt
lacksBildergalerie.cObject.switchableControllerActions.SpitalInfoPA.1 = completeBildergalerie
// build a list of PIDs that are going to be marked in navigation
lackPIDs.cObject = COA
lackPIDs.cObject {
10 = TEXT
10 {
value = {$config.PIDLists.anfahrt},
if {
value = 1
equals.data = register:lacksAnfahrt
}
}
20 < .10
20.value = {$config.PIDLists.bildergalerie},
20.if.equals.data = register:lacksBildergalerie
30 < .10
30.value = {$config.PIDLists.aktivitaeten},
30.if.equals.data = register:lacksAktivitaeten
// don't let the comma separated list end with a comma
99 = TEXT
99.value = 0
} // lackPIDs
} // REGISTER
// mark incomplete pages with a red exclamation mark
20 { // = HMENU
1 { // = TMENU
NO { // = 1
stdWrap.wrap = |<span class="warning lacksInfo">!</span>
stdWrap.wrap.if {
value.data = register:lackPIDs
isInList.field = uid
}
}
}
}
If i print out register:lacksBildergalerie and all the others, their values are correct (0 or 1).
But the lackPIDslist always empty (except of the 0 at the end)... There must be something wrong with the middle part:
10 {
value = {$nav.PIDLists.anfahrt},
if {
value = 1
equals.data = register:lacksAnfahrt
}
}
This evaluation seams to return false in any case.
I also tried with different if function like:
10 {
value = {$nav.PIDLists.anfahrt},
if {
isTrue.data = register:lacksAnfahrt
}
}
But this doesn't solve the problem.
Just overlooked that the other registers are using USER_INT as well