Get website name using TypoScript?

我是研究僧i 提交于 2019-12-08 13:18:57

问题


Is there a way to get the website name using TypoScript?

In my TypoScript template I am using

data = page : name

to get the name of the current page I am on e.g. About.

I need to get the webiste name as well, so I have tried

data = site : name

but this is not correct and I can't find the correct data name for the website name in the documentation.

NOTE: by website name I mean the Sitename entered in the template settings.


回答1:


With line below you need to know used uid of the TypoScript template entry from table sys_template, where uid=1 in example below:

data = DB:sys_template:1:title

Or maybe you want use the sitename as set for your installation:

data = GLOBAL:TYPO3_CONF_VARS|SYS|sitename



回答2:


I found this solution on http://www.sk-typo3.de/Seitentitel-aendern.58.0.html from Waldgeist. It reads from the TSFE without a DB query.

  lib.siteTitle = TEXT
  lib.siteTitle{
    data = TSFE:tmpl|sitetitle
    attribute = property
  }


来源:https://stackoverflow.com/questions/42434429/get-website-name-using-typoscript

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!