如何在TCA中创建链接输入字段

时间:2013-01-16 12:23:18

标签: typo3-tca

我需要像Typo3标准一样的功能。你可以选择一个链接(外部网站,内部网站,文件等)

我该怎么做?

4 个答案:

答案 0 :(得分:14)

您可以在文件typo3 / sysext / cms / tbl_tt_content.php和typo3 / sysext / cms / tbl_cms.php中找到TYPO3后端的TCA。 在这里您可以找到header_link示例。

TYPO3 6.1及更低版本的解决方案:

'header_link' => array(
    'label' => 'LLL:EXT:cms/locallang_ttc.xml:header_link',
    'exclude' => 1,
    'config' => array(
        'type' => 'input',
        'size' => '50',
        'max' => '256',
        'eval' => 'trim',
        'wizards' => array(
            '_PADDING' => 2,
            'link' => array(
                'type' => 'popup',
                'title' => 'LLL:EXT:cms/locallang_ttc.xml:header_link_formlabel',
                'icon' => 'link_popup.gif',
                'script' => 'browse_links.php?mode=wizard',
                'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1',
            ),
        ),
        'softref' => 'typolink',
    ),
),

TYPO3 6.2.x的解决方案 - 7.6.x:

'header_link' => array(
    'label' => 'LLL:EXT:cms/locallang_ttc.xml:header_link',
    'exclude' => 1,
    'config' => array(
        'type' => 'input',
        'size' => '50',
        'max' => '256',
        'eval' => 'trim',
        'wizards' => array(
            '_PADDING' => 2,
            'link' => array(
                'type' => 'popup',
                'title' => 'LLL:EXT:cms/locallang_ttc.xml:header_link_formlabel',
                'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_link.gif',
                'module' => array(
                    'name' => 'wizard_element_browser',
                    'urlParameters' => array(
                        'mode' => 'wizard',
                        'act' => 'page'
                    )
                ),
                'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1',
            ),
        ),
        'softref' => 'typolink',
    ),
),

TYPO3 8.x的解决方案:

'header_link' => array(
    'label' => 'LLL:EXT:cms/locallang_ttc.xml:header_link',
    'exclude' => 1,
    'config' => array(
        'type' => 'input',
        'renderType' => 'inputLink',
),

答案 1 :(得分:6)

TCA在TYPO3的新版本7中看起来略有不同:

        'link' => array(
            'label' => 'LLL:EXT:cms/locallang_ttc.xlf:header_link',
            'exclude' => 1,
            'config' => array(
                'type' => 'input',
                'size' => '50',
                'max' => '1024',
                'eval' => 'trim',
                'wizards' => array(
                    'link' => array(
                        'type' => 'popup',
                        'title' => 'LLL:EXT:cms/locallang_ttc.xlf:header_link_formlabel',
                        'icon' => 'link_popup.gif',
                        'module' => array(
                            'name' => 'wizard_element_browser',
                            'urlParameters' => array(
                                'mode' => 'wizard'
                            )
                        ),
                        'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
                    )
                ),
                'softref' => 'typolink'
            )
        ),

答案 2 :(得分:5)

在TYPO3 8.x中,这非常简单,只需将'renderType' => 'inputLink'添加到input字段即可。

答案 3 :(得分:4)

以下适用于TYPO3 7.6.X

{
"_id": ObjectId("584961127ac6f64c398b456a"),
"ProductList": [{
    "_id": "584961127ac6f64c398b4567",
    "status": "pending"
}, {
    "_id": "584961127ac6f64c398b4567",
    "status": "ready"
}, {
    "_id": "584961127ac6f64c398b4567",
    "status": "accepted"
}, {
    "_id": "584961127ac6f64c398b4567",
    "status": "delivered"
}, ],
"current_status" : "pending",
}