How to define the category Select a return value of the user function in Typoscript

advertisements

I have a user function that return a list of categories (f.e. 20, 19) and I want to set in tt_news categorySelection as indicate the code

plugin.tt_news {
 categorySelection = user_ttNewsCategoriesByUID
 categoryMode = 2
}

Before of this I have the user function and works correctly

page.105 = USER
page.105 {
  includeLibs = EXT:tt_news/Categorias.php
  userFunc = user_ttNewsInCat
}

I am looking but I have not found something. How can I set the return of function in categorySelection


Since categorySelection is stdWrap enabled (see reference), you should be able to make use of it like this:

plugin.tt_news {
 categorySelection >
 categorySelection.cObject = USER
 categorySelection.cObject.userFunc = user_ttNewsCategoriesByUID
 categoryMode = 2
}