TYPO3 FAL:启用Alt文本和自定义域字段链接 [英] TYPO3 FAL: enable Alt text and Link for custom domain field

查看:118
本文介绍了TYPO3 FAL:启用Alt文本和自定义域字段链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个产品扩展,其中包含一个db表tx_xxxproducts_domain_model_product,其中包含附件字段:

I have a "Products" extension with a db table "tx_xxxproducts_domain_model_product" having a field "accessories":

'accessories' => array(
    'exclude' => 0,
    'label' => 'LLL:EXT:xxx_products/Resources/Private/Language/locallang_db.xlf:tx_xxxproducts_domain_model_product.accessories',
    'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('accessories', array( 
        'appearance' => array( 
            'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference', 
            'collapseAll' => TRUE, 
        ), 
    ), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']) 
),

此字段应包含对图像的引用。
它有效,但文件引用只有字段标题和描述。
我如何添加链接和备用文本,因为默认的图像CType有?

This field should have references to images. It works, but the file references only have the fields Title and Description. How can I add Link and Alternative Text, as the default Images CType has?

谢谢。

推荐答案

我在tt_content的TCA中找到了答案:

I found the answer in tt_content's TCA:

'accessories' => array(
    'exclude' => 0,
    'label' => 'LLL:EXT:xxx_products/Resources/Private/Language/locallang_db.xlf:tx_xxxproducts_domain_model_product.accessories',
    'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('accessories', array( 
        'appearance' => array( 
            'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference', 
            'collapseAll' => TRUE, 
        ), 
        'foreign_types' => array(
            '0' => array(
                'showitem' => '
                    --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                    --palette--;;filePalette'
            ),
            \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
                'showitem' => '
                    --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                    --palette--;;filePalette'
            ),
        )
    ), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']) 
),

检查'foreign_types'键。

Check the 'foreign_types' key.

这篇关于TYPO3 FAL:启用Alt文本和自定义域字段链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆