Set levels property for menu_subpages depdending on layout - typo3

I have the following typoscript configuration for the menu_subpages object:
tt_content.menu_subpages {
dataProcessing {
10 {
levels = 1
as = menu
expandAll = 1
includeSpacer = 1
}
}
}
To give the editor more flexibility I want to set the levels property depending on the selected layout of the content object. I've tried to use the CASE object but this doesn't seem to work:
tt_content.menu_subpages {
dataProcessing {
10 {
levels = CASE
levels {
key.field = layout
default = TEXT
default.value = 1
1000 = TEXT
1000.value = 7
}
...
}
}
}
Thanks for any help!

As levels is no object but a property you can't use it as an object.
Either you change it to an object:
tt_content.menu_subpages {
dataProcessing {
10 {
levels.cObject = CASE
levels.cObject {
:
}
...
}
}
}
Or you need to set the value inside a typoscript condition.
tt_content.menu_subpages {
dataProcessing {
10 {
// default:
levels = 1
...
}
}
}
[page['layout'] == 1000]
tt_content.menu_subpages.dataProcessing.10.levels = 7
[page['layout'] = 2000]
tt_content.menu_subpages.dataProcessing.10.levels = 3
[global]

Related

How do I override HMENU Special setting based on layout?

I have a menu element that is set to list the selected pages.
tt_content.my_menu {
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
special = list
special.value.field = pages
}
}
}
How can I change this to a directory of pages when a specific layout is set?
tt_content.my_menu {
dataProcessing {
10 {
special {
override = directory
override.if.value = my-layout
override.if.equals.field = layout
}
}
}
}
I'm not sure if MenuProcessor? has stdWrap on its properties.
But it should be possible to define two processors, each with an if:
tt_content.my_menu {
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
if {
value = my-layout
equals.field = layout
negate = 1
}
special = list
special.value.field = pages
}
20 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
20 {
if {
value = my-layout
equals.field = layout
}
special = directory
special.value.field = pages
}
}
}

TYPO3 News Title in breadcrumb with MenuProcessor

is it possible to show the current news title in breadcumb with the MenuProcessor?
I've tried some with DatabaseQueryProcessor but I don't get the data.
Have someone a working example or a tutorial for me?
At the moment I have only this:
temp.breadcrumb = FLUIDTEMPLATE
temp.breadcrumb {
templateName = breadcrumb
templateRootPaths {
10 = fileadmin/resources/private/template/menu/
}
partialRootPaths {
10 = fileadmin/resources/private/template/partials/
}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
special = rootline
special.range = 0|-1
includeNotInMenu = 1
as = menuBreadcrumb
}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
if.isTrue.field = records
table = tx_news_domain_model_news
}
}
}
}

TYPO3 Formhandler Finisher_Mail multiple receivers with to_email + addTolist

I have a formhandler-form and I'm trying to find a good way to send an admin mail to multiple recipients with one mail finisher. The Problem is the recipients are variable. The recipients of the mail depends on the selection of 10 checkboxes in the form. Each selection should have the effect that a new recipient is added. At the moment it's solved with 10 mail finisher like
if {
1 {
conditions {
OR1.AND1 = checkbox_1 = 1
}
isTrue {
finishers.1.config.admin.to_email = p1#mail.com
}
else {
finishers.1.config.admin.disable = 1
}
}
2 {
conditions {
OR1.AND1 = checkbox_2 = 1
}
isTrue {
finishers.2.config.admin.to_email = p2#mail.com
}
else {
finishers.2.config.admin.disable = 1
}
}
...
Is there a better way? I tried to solve this with one finisher and the usage of addToList
if {
1 {
conditions {
OR1.AND1 = checkbox_1 = 1
}
isTrue {
finishers.1.config.admin.to_email := addToList(p1#mail.com)
}
}
2 {
conditions {
OR1.AND1 = checkbox_2 = 1
}
isTrue {
finishers.1.config.admin.to_email := addToList(p2#mail.com)
}
}
...
But it doesn't work. With 4 selected boxes it is still one recipient. Why?
don't forget: typoscript is a configuration language, no programming language.
so you need another logic to build up the multiple receivers.
something like:
:
finishers.1.config.admin.to_email = COA
finishers.1.config.admin.to_email {
10 = TEXT
10.value = p1#mail.com,
10.if.isTrue.data = checkBox_1
20 = TEXT
20.value = p2#mail.com,
20.if.isTrue.data = checkBox_2
30 = TEXT
30.value = p3#mail.com,
30.if.isTrue.data = checkBox_3
stdWrap.substring = 0,-1
}

TYPO3 backend user right for columns

I would like to assign BE User rights to specific columns in BE Layout (Field colPos): A usergroup shall not be able to edit one column.
Any ideas?
use condition in page tsconfig:
[usergroup = 2]
mod {
web_layout {
BackendLayouts {
standard {
config {
backend_layout {
rows {
1 {
columns {
1 {
colPos =
}
}
}
}
}
}
}
}
}
}
[global]

MaxGalleryWidth for fluid_styled_content

I tried to change the MaxGalleryWidth in fluid_styled_content for an specific column.
First I tried how I do this before fluid_styled_content:
lib.contentRight = COA
lib.contentRight {
10 = LOAD_REGISTER
10 {
maxImageWidth = 205
maxImageWidthInText = 60
}
20 < styles.content.get
20 {
select {
where = colPos=1
}
slide = -1
}
90 = RESTORE_REGISTER
}
Also using maxGalleryWidth in LOAD_REGISTER has no effect.
This doesn't work for me. Than I tried to set the maxGalleryWidth Parameter for the GalleryProcessor, but this seems not to have any effect:
lib.contentRight < styles.content.get
lib.contentRight {
select {
where = colPos=1
}
slide = -1
renderObj = < tt_content
renderObj.textmedia.dataProcessing.20 {
maxGalleryWidth = 205
maxGalleryWidthInText = 60
}
}
Finaly I got it only to work with an override and if condition:
tt_content.textmedia.dataProcessing.20 {
maxGalleryWidth.override.cObject = TEXT
maxGalleryWidth.override.cObject {
value = 205
if {
value = 1
equals.field = colPos
}
}
maxGalleryWidthInText.override.cObject = TEXT
maxGalleryWidthInText.override.cObject {
value = 60
if {
value = 1
equals.field = colPos
}
}
}
For me it looks wrong, are there other ways to realize it correctly without using override?