简体   繁体   中英

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.

I realize this with the following TypoScript code:

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

$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).

Now you can on any page override this setting, and it is automatically applied to all subpages of that page as well =)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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