根模板中的条件TypoScript常量

时间:2013-12-19 14:42:52

标签: typo3 typoscript open-graph-protocol

我在使用两种语言的网站上使用jh_opengraphprotocol。文档告诉我在页面根模板中设置常量:

plugin.jh_opengraphprotocol.description = Foo Bar
plugin.jh_opengraphprotocol.sitename = Foo Bar
plugin.jh_opengraphprotocol.image = /uploads/tx_jhopengraphprotocol/foobar.jpg
plugin.jh_opengraphprotocol.type = website
plugin.jh_opengraphprotocol.title = 

这样做,并且OG标签显示在前端。但我的网站是双语的 - 所以我在哪里可以添加语言的条件?我试过这个:

[globalVar = GP:L=0]
plugin.jh_opengraphprotocol.description = Foo Bar German
plugin.jh_opengraphprotocol.sitename = Foo Bar
plugin.jh_opengraphprotocol.image = /uploads/tx_jhopengraphprotocol/foobar.jpg
plugin.jh_opengraphprotocol.type = website
plugin.jh_opengraphprotocol.title = 
[end]

[globalVar = GP:L=1]
plugin.jh_opengraphprotocol.description = Foo Bar English
plugin.jh_opengraphprotocol.sitename = Foo Bar
plugin.jh_opengraphprotocol.image = /uploads/tx_jhopengraphprotocol/foobar.jpg
plugin.jh_opengraphprotocol.type = website
plugin.jh_opengraphprotocol.title = 
[end]

但是常量根本没有设置。如何为两种语言设置它们?

1 个答案:

答案 0 :(得分:2)

对于默认语言,不需要任何条件。仅对替代语言进行更改:

plugin.jh_opengraphprotocol.description = Foo Bar German
plugin.jh_opengraphprotocol.sitename = Foo Bar
plugin.jh_opengraphprotocol.image = /uploads/tx_jhopengraphprotocol/foobar.jpg
plugin.jh_opengraphprotocol.type = website
plugin.jh_opengraphprotocol.title = 

[globalVar = GP:L=1]
plugin.jh_opengraphprotocol.description = Foo Bar English
[end]