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

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

Related

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

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

Check field on parent page in TMENU?

In a TMENU, can I check the value of a field on the parent page?
I want to do something like this:
lib.mymenu = HMENU
lib.mymenu {
entryLevel=0
1 = TMENU
1 {
...
}
2 < .1
2 {
NO {
stdWrap.wrap {
if.equals.field = parent:myfield
if.value = 1
cObject < lib.specialmenu
}
}
}
}
Does the parent mean the item of the first level in this case? Or in other words: a field in the record which UID is the PID of the current item?
Then, there's a (german) blogpost on how to get dynamically fields via stdWrap:
https://blog.marit.ag/2009/12/15/datenbankfelder-stdwrap-data/
guess you have to implement a custom menuprocessor, or try at least a fluid version of your menu. in plain typoscript i dont know a solution for this.
this link may help you for my suggestion: https://docs.typo3.org/m/typo3/tutorial-sitepackage/master/en-us/MainMenuCreation/Index.html

Typo3 Fluid Templates - How to set up different templates for different pages

I'm trying to build from scratch a website with typo3 9.5 and setting up different template files for different pages. How do I achieve this?
I'm following the tutorial from https://docs.typo3.org/m/typo3/tutorial-sitepackage/master/en-us/TypoScriptConfiguration/Index.html and also tried the solution with no success provided at Typo3 Fluid Templates How to add multiple templates
Now all pages load the Default template and if I set the default cObject to Alternative, it loads the Alternative.html to all pages, even when the TCA at Typo3 is set correctly for each page:
All Pages Back-end Layout to [Default]
Contact set to [Alternative].
_
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
pagets__alternative = TEXT
pagets__alternative.value = Alternative
alternative = TEXT
alternative.value = Alternative
}
templateRootPaths {
0 = EXT:photo/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
partialRootPaths {
0 = EXT:photo/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
layoutRootPaths {
0 = EXT:photo/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
levels = 1
includeSpacer = 1
as = mainnavigation
}
}
}
I want to use for instance a default.html template for all pages except contact page, which will have it's own template ( site_template/Resources/Private/Templates/Page/Alternative.html ).
First:
you should use higher numbers for the paths to your templates.
The higher the number the higher the priority for overriding files with the same name.
second:
there is no field pagelayout. either use layout or better backend_layout and backend_layout_next_level (example configuration with the full usage of configuration for subpages).
Your key values (pagets__default and pagets__alternative) already hint to the usage of backend_layout (pagets__* is the usual key for backend layouts defined in page TSconfig).
Probably the example in the documentation needs some correction. (Pull-request commited)

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.

Solr Indexing - Manipulating the search result

I am working with the TYPO3 Solr extension and I have some doubts regarding the solr result set manipulation.
I have added a special configuration for indexing some particular pages in my page tree. ie Pages that starts with the label "Expertise%" .I have managed to added this successfully . And the indexing is working successfully with our any trouble. But what I would like to achieve is that , I want to added parent page title to the search result.i.e
This is the page tree
|---- 1.00.100 (parent page)
|--Subpage 1
|--Subpage 2
|--Expertise
|--Test page`
And in the solr search result should be
1.00.100 - Expertise
Is this possible in TYPO3 Solr. Is there any hook or signalslot available to implement this?
Tried this ,But doesn't seems to work for me ?
plugin.tx_solr.index.queue.expertise_offered = 1
plugin.tx_solr.index.queue.expertise_offered {
table = pages
additionalWhereClause = doktype = 1 AND no_search = 0 AND title LIKE '%Expertise offered%'
fields {
title = title
content = CONTENT
parentPageTitle_stringS = CONTENT
parentPageTitle_stringS {
table = pages
select {
selectFields = title
where = uid = ###pid###
}
markers {
pid.data = field:pid
}
}
content {
table = tt_content
select {
selectFields = header, bodytext
}
renderObj = COA
renderObj {
10 = TEXT
10.field = header
# This removes HTML tags
11 = SOLR_CONTENT
11.field = bodytext
}
}
url = TEXT
url.typolink.parameter = TEXT
url.typolink.parameter.field = uid
}
}
You probably don't need any hook or signal-slot. You can do it as follows:
Add the title of the parent page to your indexing configuration. There is no field for it, but you can dynamically add fields to SOLR documents. This is done by sending the data in a field which has a certain suffix, which determines the field type.
For example: Setting the field parentPageTitle_stringS to the parent pages title in the indexing configuration creates a new stored, single-valued field of type string in the indexed document.
Filling this field could look like this:
plugin.tx_solr {
index {
queue {
<yourindexconfigname> = 1
<yourindexconfigname> {
table = pages
fields {
parentPageTitle_stringS = CONTENT
parentPageTitle_stringS {
# Build a query here to retrieve
# the parent page title.
}
}
}
}
}
}
In your template for search results, you can use the marker ###RESULT_DOCUMENT.parentPageTitle_stringS### to retrieve the field.
The available field types can be found in EXT:solr/Resources/Solr/typo3cores/conf/general_schema_fields.conf from line 157 onwards (refering to version 3.0.0 here).
You should of course use a type other than string if you want to have the result indexed nicely.