问题
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