0

I'm using TYPO3 v10.4.12 and 'news' extension v8.5.2 I add "News" page where I have two columns. In first I have "news list" with pagination and e.g. 10 news per page and in sidebar I have "date menu". All is working fine but I need one thing.

When I click on "News" in main menu I see those 10 news but I want to see only news from last month. Same effect I can get when I click on last month in date menu. So is there any trick to get last month url in typoscript (or any other way) and redirect main menu page to it?

qmon
  • 9
  • 1

1 Answers1

0

I am not aware of a native way in EXT:news to limit to the last month.

Since the link to the desired view URL is also dynamic and might contain parameters (maybe rewritten to nice URLs) like ?tx_news_pi1[overwriteDemand][month]=12&tx_news_pi1[overwriteDemand][year]=2020&cHash=... I am going to propose a little hacky JavaScript solution...

// follow first news date menu link if accessed without parameters
if (location.pathname === '/news' && location.search === '') {
  var linkEl = document.querySelector('.news-menu-view a')
  if (null !== linkEl) location.href = linkEl.href
}

This would navigate to the first link in the date menu.

Jonas Eberle
  • 2,835
  • 1
  • 15
  • 25