【问题标题】:TYPO3 new tab to custom extensionTYPO3 自定义扩展的新标签
【发布时间】:2021-11-02 10:48:49
【问题描述】:

我编写自己的扩展程序。我有文件 tx_xyz_domain_model_abc.php 使用以下代码:

'types' => [
    '1' => [
        'showitem' => '
            --div--;Article, title,
            --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language, sys_language_uid, l10n_parent, l10n_diffsource, 
            --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, hidden, starttime, endtime,
    '],
],

所以第一行是我的新领域。其他行是 TYPO3 默认值。 A --div-- 是一个新选项卡。如何将媒体或常规选项卡添加到我的扩展程序? 我已经尝试添加

--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.general;general,

但是没有新标签。我该怎么做?

【问题讨论】:

  • ExtJS 里好像不是真的。可以去掉标签吗?
  • 我应该删除哪个标签?
  • 你有一个名为 Article 的新标签吗?如果不是,则可能是缓存问题。停用并重新激活您的扩展程序。
  • 是的,我的文章标签在那里。语言和访问选项卡。但是没有用于一般 TYPO3 内容的选项卡,例如标题和标题位置。
  • 去掉ExtJS标签

标签: typo3


【解决方案1】:

--palette--; 将在当前选项卡 (-> TCA ref) 中插入一个新调色板(=分组字段)。

在不定义选项卡的情况下,字段会自动放在“常规”选项卡的第一个位置。

'types' => [
   '0' => [
      'showitem' => '
         hidden, title,
         --div--;LLL:EXT:examples/locallang_db.xml:tx_examples_product.images, image1, image2,
      '
   ],
],

对于更多选项卡,您需要在字段列表中插入“--div--;label”-值(-> TCA ref):

'types' => [
   '0' => [
      'showitem' => '
         hidden, title,
         --div--;LLL:EXT:examples/locallang_db.xml:tx_examples_product.text, description, teaser,
         --div--;LLL:EXT:examples/locallang_db.xml:tx_examples_product.images, image1, image2,
      '
   ],
],

【讨论】:

  • 即使使用--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, general,,也没有包含一般信息的新标签。是因为我有自己的数据库字段吗?
  • 你有一个名为general的字段吗?如果该选项不存在并且选项卡中不应显示其他字段,则选项卡将不会显示(因为它是空的)。
【解决方案2】:

无法在您的扩展程序中显示核心常规选项卡。您使用自己的数据模型编写了自己的扩展。这保存在 db 表 tx_xyz_domain_model_abc 中。但核心数据来自具有单独 TCA 的表 tt_content。

你可以

  1. 使用您的扩展扩展表 tt_content。然后您可以使用 tt_content 中的字段

  2. 在扩展和表格中添加标题等字段

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-08-31
    • 2011-04-19
    • 1970-01-01
    • 1970-01-01
    • 2015-07-21
    • 1970-01-01
    • 2023-01-04
    • 2018-05-04
    相关资源
    最近更新 更多