簡體   English   中英

"TYPO3 為 IRRE tt_content 隱藏 colPos"

[英]TYPO3 hide colPos for IRRE tt_content

當按照文檔<\/a>中的說明添加自己的內容元素,然后實現所謂的 IRRE(內聯類型)元素時,可以將其存儲在未使用的 colPos 中,例如 99:

$newTCAcolumns[] = [
'xxx_cta_blocks' => [
    'exclude' => 1,
    'label' => 'Content',
    'config' => [
        'type' => 'inline',
        'allowed' => 'tt_content',
        'foreign_table' => 'tt_content',
        'foreign_sortby' => 'sorting',
        'foreign_field' => 'xxx_foreign',
        'minitems' => 1,
        'maxitems' => 3,
        'appearance' => [
            'collapseAll' => true,
            'expandSingle' => true,
            'levelLinksPosition' => 'bottom',
            'useSortable' => true,
            'showPossibleLocalizationRecords' => true,
            'showRemovedLocalizationRecords' => true,
            'showAllLocalizationLink' => true,
            'showSynchronizationLink' => true,
            'enabledControls' => [
                'info' => false,
            ]
        ],
        'behaviour' => [
            'allowLanguageSynchronization' => true,
        ],
        'overrideChildTca' => [
            'columns' => [
                'colPos' => [
                    'config' => [
                        'default' => 99
                    ]
                ],
                'CType' => [
                    'config' => [
                        'default' => 'xxx_cta_block'
                    ]
                ],
            ]
        ],
    ],
]

PagelayoutHook 實際上是可行的方法。 目前沒有其他辦法。 如果你想自己實現它,這很容易。

我在這里解釋了一切。

隱藏未使用的元素

TYPO3 正在向 PSR 標准遷移,因此 Hooks 正在被替換。 慢慢地,但它們最終會消失。 相反,事件/監聽將取代它們的位置。 到時候,大家都會開心的:)

不要上癮,聽事件! PSR-14

最好的祝福

使用 TSconfig,您可以限制后端用戶可以編輯的列:
手冊

// just edit columns 0,1 and 2, even when there are columns 3,4 and 5
mod.SHARED.colPos_list = 0,1,2

此外,您可以禁用所有受限列,因為此更改

// hide all columns the user can't edit
mod.web_layout.hideRestrictedCols = 1

此 TSConfig 應該可用於限制所有人的頁面,或者用戶/用戶組僅限制某些編輯器

這似乎只在頁面 TSconfig 中有效,而在用戶 TSconfig 中不再有效:

mod.SHARED.colPos_list

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM