0

Using PageTSConfig I want to add some template options to the tx_news plugin. How do I make it so that List template options are only shown when list view is active, and the same for Detail template options?

I thought it would be something like this:

tx_news.templateLayouts {
    types {
        list {
            1 = Alt List 
        }
        detail {
            2 = Alt Detail
        }
    }
}
user500665
  • 1,220
  • 1
  • 12
  • 38

1 Answers1

1

By PageTS it's only possible to handle different list templates, the code must look like this:

tx_news.templateLayouts {
   1 = A custom layout
   99 = LLL:fileadmin/somelocallang/locallang.xlf:someTranslation
}

For different detail views you need to use TypoScript settings options.

All examples you can see here: https://docs.typo3.org/p/georgringer/news/main/en-us/Tutorials/Templates/TemplateSelector/Index.html

Thomas Löffler
  • 5,922
  • 1
  • 14
  • 29
  • Oh well, that's a shame. I ended up using `--div--` to visually separate the List templates from the Detail Templates. But it would have been nice to have it reload the field like it does with all the other fields in the plugin. – user500665 Feb 01 '22 at 20:47