简体   繁体   English

Typo3,为 Mask Elements 设置标题

[英]Typo3, set title for Mask Elements

I have a typo3 server and using the mask extension.我有一个typo3 服务器并使用掩码扩展。 When an editor creates a new mask element, there isnt a title in the list view.当编辑器创建新的掩码元素时,列表视图中没有标题。 Its always "no title":它总是“没有标题”:

在此处输入图片说明

I checked the database and found the titles in the db in the field: tt_content.header but no way to set them automatically oder manually by an editor.我检查了数据库并在字段中的数据库中找到了标题:tt_content.header 但无法通过编辑器手动设置它们。 Anyone have an idea how the title can be set automatically?任何人都知道如何自动设置标题? Oder manually by an editor?由编辑手动订购?

ext: mask has the option to reuse existing fields of tt_content for new kinds of content elements (CEs). ext: mask可以选择将tt_content现有字段tt_content用于新类型的内容元素 (CE)。 use it to get the bonus of better interoperability with TYPO3.使用它来获得与 TYPO3 更好的互操作性的好处。

TYPO3 has a logic how to show records (content elements) in the backend. TYPO3 有一个逻辑如何在后端显示记录(内容元素)。 one of it is the usage of the fields header and description .其中之一是字段headerdescription if you reuse these fields your CEs will look like others automatically.如果您重用这些字段,您的 CE 将自动看起来像其他字段。

If you use other fields you need to declare your fields for usage AND in case you change the kind of a CE from your kind to eg TEXT with Media the header stays.如果您使用其他字段,您需要声明您的字段以供使用,并且如果您将 CE 的种类从您的种类更改为例如TEXT with MediaTEXT with Media标题保持不变。

Especially header is handled in the layout/partial of FSC or CSC global for any kind of CE.特别是在任何类型的 CE 的 FSC 或 CSC 全局布局/部分中处理header if the handling/rendering is changed (eg special layout) in an installation your CEs need special effort if they have their own building of the header.如果在安装中更改处理/渲染(例如特殊布局),您的 CE 需要特别努力,如果他们有自己的标题构建。

Try to use the same fields as existing CEs and your life can be easier.尝试使用与现有 CE 相同的领域,您的生活会更轻松。

I'm having the same issue, but I found a way around it for the meantime.我遇到了同样的问题,但我找到了解决方法。 I edit the mask element and chenge its type to something else—like Text—where I can set the title.我编辑掩码元素并将其类型更改为其他内容(例如文本),我可以在其中设置标题。 After typing the title I save it, then change back to mask element and save again.输入标题后我保存它,然后改回掩码元素并再次保存。 This works by me without losing the content of the mask element.这对我有用而不会丢失掩码元素的内容。 This way I can see the title in typo3 backend when I view as list or page or add content from another page.这样,当我查看列表或页面或从另一个页面添加内容时,我可以在 Typ3 后端看到标题。 As I said, it doesn't solve the problem, but can help until there is a proper solution.正如我所说,它不能解决问题,但可以提供帮助,直到找到合适的解决方案。

EDIT编辑
I've just found another solution.我刚刚找到了另一个解决方案。 You can add the title field to en existing mask element.您可以将标题字段添加到现有的掩码元素。 To do it, go to ADMIN TOOLS > Mask, click your mask element to edit it.为此,请转到“管理工具”>“蒙版”,单击您的蒙版元素进行编辑。 Add a new item by dragging the 𝗦𝘁𝗿𝗶𝗻𝗴 item (the one on top of the list of available items) to the right where your items are.通过将 𝗦𝘁𝗿𝗶𝗻𝗴 项目(位于可用项目列表顶部的项目)拖动到您的项目所在的右侧来添加新项目。 Then in General under 𝗖𝗵𝗼𝗼𝘀𝗲 𝗳𝗶𝗲𝗹𝗱 dropdown choose an 𝗘𝘅𝗶𝘀𝘁𝗶𝗻𝗴 named:然后在一般下 𝗖𝗵𝗼𝗼𝘀𝗲 𝗳𝗶𝗲𝗹𝗱 下拉列表中选择一个 𝗘𝘅𝗶𝘀𝘁𝗶𝗻𝗴 命名为:

𝗛𝗲𝗮𝗱𝗲𝗿: (𝗵𝗲𝗮𝗱𝗲𝗿) 𝗛𝗲𝗮𝗱𝗲𝗿:(𝗵𝗲𝗮𝗱𝗲𝗿)

Save, close, go to your page to add your title.保存,关闭,转到您的页面以添加您的标题。 This still doesn't add the title field automatically to all mask elements, but it is a step forward.这仍然不会自动将标题字段添加到所有掩码元素,但它向前迈进了一步。

掩码元素后端标题

If anywhere, you should be able to set a static title automatically in your page tsconfig.如果在任何地方,您应该能够在您的页面 tsconfig 中自动设置静态标题。 You could to something like你可以像

mod.wizards.newContentElement.wizardItems.mask.elements.[title  of your mask element].tt_content_defValues {
    header = My Awesome title
}

Personally, I usually give every mask element a header field and ask content editors to fill it in.就个人而言,我通常给每个掩码元素一个header字段,并要求内容编辑器填写它。

See also this discussion on Mask elements and backend titles.另请参阅有关 Mask 元素和后端标题的讨论

Hope, this helps.希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM