Search code examples
typo3typoscripttypo3-7.6.xtx-news

TS property detail.registerProperties of extension news does not work for datetime


The news docs say I should set up the following code in plugin settings to get access to the corresponding register value per ts.

plugin.tx_news {
  settings {
      detail {
          registerProperties = keywords,title,datetime
      }
  }
}

This works for the title property:

20 = TEXT
20 {
    data = register:newsTitle
}  

But not for datetime:

20 = TEXT
20 {
    data = register:newsDatetime
}

I also tested crdate, tstamp and the notation newsDateTime but nothing works.

How I get access to datetime of a news item in detail view with typoscript?
Thanks in advance

Update: If I output all registers with

data = debug:register

I get

screenshot

But I didn´t know how I can access these newsDatetime => DateTime object within TS?


Solution

  • It seems this is a bug in the extension itself. I created an issue at https://github.com/georgringer/news/issues/613 for it.

    what you could do to fix this is to extend the extension described in the manual at https://docs.typo3.org/typo3cms/drafts/github/georgringer/news/DeveloperManual/ExtendNews/ProxyClassGenerator/Index.html and use a custom getter which returns the timestamp of the field.

    This has been now fixed with https://github.com/georgringer/news/commit/964e92d5043ee596d7e97a1b40986756a89a93a5 and will be part of version 7.0.0