Typo3:如何读取页面中字段的值 -> 编辑 -> 标签:元数据 [英] Typo3: How can I read the value of a field in page->edit->tab: Metadata

查看:13
本文介绍了Typo3:如何读取页面中字段的值 -> 编辑 -> 标签:元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基于一张图片、一个主标题和一个子标题创建了一个标题.

I create a header based on one image, one Main Header and one Sub Header.

页面/编辑/元数据中的以下字段/标签重命名如下:

The following fields/labels in page/edit/Metadata are renamed like that:

    TCEFORM.pages.author.label.default = HeaderImageMainTitle
    TCEFORM.pages.author_email.label.default = HeaderImageSubTitle

现在我获得了媒体的内容/创建新的关系/图像文件并且工作正常.但是上面两个标签为'author'和'author_email'的字段的值为空(格式标签在那里,但没有内容):

Now I get the content of the media/create new relation/image file and that works fine. But the values of the above two fields with former label 'author' and 'author_email' stay empty (the format tags are there, but no content):

lib.headerteaser = COA
lib.headerteaser.stdWrap.wrap = <div id="headerTeaser">|</div>

lib.headerteaser.10 = IMAGE
lib.headerteaser.10 {
  file {
    import.data = levelmedia:-1, slide
    treatIdAsReference = 1
    import.listNum = 0
  }
  wrap = |
}

lib.headerteaser.20 = TEXT
lib.headerteaser.20.data = levelfield : -1 , HeaderImageMainTitle, slide
lib.headerteaser.20.wrap = <div id="headerTeaserText"><h1>|</h1>

lib.headerteaser.30 = TEXT
lib.headerteaser.30.data = levelfield : -1 , HeaderImageSubTitle, slide
lib.headerteaser.30.wrap = <p>|</p></div>

模板中的视图助手看起来像这样:

The viewhelper in the template looks like that:

    <f:cObject typoscriptObjectPath="lib.headerteaser" />

我想念什么?在谷歌上学习了 hoooours!

What do I miss? Studied google for hoooours!!

推荐答案

我测试了这段代码,工作正常(Typo3 7.6.0).

I tested this code, works correctly (Typo3 7.6.0).

我测试过的 Typoscript 设置(没有图像):

My tested Typoscript setup (without image):

lib.headerteaser = COA
lib.headerteaser.stdWrap.wrap = <div id="headerTeaser">|</div>

lib.headerteaser.20 = TEXT
lib.headerteaser.20.data = levelfield:-1, author, slide
lib.headerteaser.20.wrap = <div id="headerTeaserText"><h1>|</h1>

lib.headerteaser.30 = TEXT
lib.headerteaser.30.data = levelfield:-1, author_email, slide
lib.headerteaser.30.wrap = <p>|</p></div>

page = PAGE
page.10 < lib.headerteaser

设置typo3conf/LocalConfiguration.php:

Setup typo3conf/LocalConfiguration.php:

<?php
return [
    ...
    'FE' => [
        'addRootLineFields' => ',author,author_email',
    ],
    ...
];

加上清除 Typo3 缓存.

Plus clear Typo3 cache.

这篇关于Typo3:如何读取页面中字段的值 -> 编辑 -> 标签:元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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