Search code examples
typo3fluidtx-news

How can I put multiple tx_news with different configurations in same page


I'm using Bootstrap tabs with tx_news. Each of the tab is using a search news and a listing of the results. Each tab can have a different itemsPerPage and categories.

How can I put multiple tx_news config on the same page? If not, can you give me a hint?


Solution

  • The short version: you can't, because the plugins share the scope used to separate URL arguments and thus all plugin instances will react to them.

    The long version: you sort of can, but it involves defining new plugin types for each of those that you want to be different. In other words, you'd have to register completely new plugins with new plugin scopes that are separate, so that your URLs will use one unique scope per plugin you used.

    Note that you may also need to overwrite one or more templates to add passing of existing URL arguments from external scopes, if you wish a link in instance A to preserve the parameters given to instance B in the current URL.

    PS: you might have an easier time with this if you implement it as XHR and create a custom PAGE TypoScript object with a typeNum and then provide that as source. It completely depends on your desired integration though - switching to XHR carries other problems with it, such as not being able to consistently generate a URL from the JS client side and thus having to disable caching for the custom PAGE object which leaves an open vector for DDOS attacks. Consider both options carefully before you decide.