I want to use a conditional statement for applying a different template to News (tt_news). Currently I use a user function that returns true/false. If the current News has a specific category and works correctly return 1
otherwise return Null
.
I followed the official documentation and other sites, so I made the condition
[userFunc = user_isLatin]
plugin.tt_news.templateFile = fileadmin/templates/plugins/tt_news/latin_detail.html
page.1010 = TEXT
page.1010.value = LATIN
[ELSE]
plugin.tt_news.templateFile = fileadmin/templates/plugins/tt_news/general_detail.html
page.1010 = TEXT
page.1010.value = OTHERS
[END]
but it always shows OTHERS
. I tried the following with variables
temp.catuid = USER
temp.catuid.preUserFunc = user_ttNewsInCat
latin = TEXT
latin.value < temp.catuid
[latin.value = 1]
....
[ELSE]
....
[END]
but it doesn't work either.