How can i make a Link input Field in TCA

2019-06-21 14:59发布

I need the same function like the Typo3 standard. There U can Choose a Link (external Site, internal Site, File, etc.)

How can I make this?

标签: typo3-tca
4条回答
太酷不给撩
2楼-- · 2019-06-21 15:15

In TYPO3 8.x, this is very simple, just add 'renderType' => 'inputLink' to your input field.

查看更多
Explosion°爆炸
3楼-- · 2019-06-21 15:33

The TCA looks slightly different in the new version 7 of TYPO3:

        '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'
            )
        ),
查看更多
干净又极端
4楼-- · 2019-06-21 15:34

Following will work for TYPO3 7.6.X

'detailpage' => array(
            'exclude' => 1,
            'label' => 'LLL:EXT:myExt/Resources/Private/Language/locallang_db.xlf:tx_myExt_domain_model_mdl1.detailpage',
            'config' => array(
                'type' => 'input',
                'size' => 30,
                'eval' => 'trim',
                'wizards' => array(
                    '_PADDING' => 2,
                    'link' => array(
                        'type' => 'popup',
                        'title' => 'LLL:EXT:cms/locallang_ttc.xml:header_link_formlabel',
                        'icon' => 'link_popup.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',
            ),
),
查看更多
可以哭但决不认输i
5楼-- · 2019-06-21 15:38

You can find the TCA for the TYPO3 backend in the files typo3/sysext/cms/tbl_tt_content.php and typo3/sysext/cms/tbl_cms.php. Here you find the header_link example.

Solution for TYPO3 6.1 and lower:

'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',
    ),
),

Solution for 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',
    ),
),

Solution for TYPO3 8.x:

'header_link' => array(
    'label' => 'LLL:EXT:cms/locallang_ttc.xml:header_link',
    'exclude' => 1,
    'config' => array(
        'type' => 'input',
        'renderType' => 'inputLink',
),
查看更多
登录 后发表回答