简体   繁体   English

Typo3:使用来自Hom页面的元数据

[英]Typo3: Use the Metadata from Hom Page

I'm using Typo3 and use the fields "metadata" on each page in order to specify the metadata. 我正在使用Typo3,并在每个页面上使用字段“元数据”来指定元数据。

I realize this with the following TypoScript code: 我通过以下TypoScript代码实现了这一点:

page.meta.keywords.field = keywords
page.meta.description.field = description
page.meta.robots= index, follow

Now I would like on the sides where no metadata is specified using the data from the home page. 现在,我想在两面使用主页中的数据未指定元数据。 How can I realize the best? 我怎样才能做到最好?

You can make use of sliding content. 您可以利用滑动内容。 This involves a little setup, but will make life alot easier for people maintaining the site. 这涉及一些设置,但是对于维护站点的人员来说,将大大简化工作。

You will need to add or alter the following line inside typo3conf/localconf.php 您将需要在typo3conf / localconf.php中添加或更改以下行

$TYPO3_CONF_VARS['FE']['addRootLineFields'] = ',description,keywords';

After that you can change your metadata like this: 之后,您可以像这样更改元数据:

page.meta.keywords.data = levelfield : -1 , keywords , slide
page.meta.description.data = levelfield : -1 , description , slide

Make sure to clear all cache. 确保清除所有缓存。 Then fill in the default values inside of the root-page (most of the times uid=1). 然后在根页面内填写默认值(大多数情况下uid = 1)。

Now you can on any page override this setting, and it is automatically applied to all subpages of that page as well =) 现在,您可以在任何页面上覆盖此设置,并且该设置也会自动应用于该页面的所有子页面=)

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

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