Ad

Add TemplateLayout Option To Tx_news Sepecific To View Type?

- 1 answer

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
        }
    }
}
Ad

Answer

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

Ad
source: stackoverflow.com
Ad