Project

General

Profile

Bug #100981

Updated by Jessica Jagodzinski 11 months ago

It seems that the site configuration is not available in the content editing view for traverse conditions. 

 To reproduce the issue, please follow these steps: 

 In the Site Configuration, add the following configuration: 

 <pre> 
 settings: 
   showHeader: 1 
 </pre> 

 In the TSconfig, TsConfig, add the following condition: 
 <pre> 
 [{$showHeader} != 1] 
   TCEFORM.tt_content.CType.removeItems := addToList(header) TCEFORM.tt_content.header.disabled = 1 
 [global] 
 </pre> 

 Result: The Header element is displayed in the new Content Wizard. Even when creating a new element, Header remains available in the CType selection. 

 However, this approach leads to excessive log entries. The recommendation is to use traverse. 

 Now, instead of the above condition in TsConfig, use the following condition: 

 <pre> 
 [traverse(site('configuration'), 'settings/showHeader') != 1] 
   TCEFORM.tt_content.CType.removeItems := addToList(header) 
 [global] 

 </pre> 
 The Header element will still be displayed in the new Content Wizard, but it will no longer appear in the CType selection when creating or editing an element. 

 In this test, the value in the Site Configuration does not affect the behavior, as it seems that Site Configuration is not available in the Content Editing for traverse. 

 (If you change the value in the Site Configuration to 0, the Header element will not be displayed in either case.) 

 I have tested the same scenario with TYPO3 12, where this behavior does not occur.

Back