Get item id from news record in detail view tx_news

533 views Asked by At

i want to use a news record id to get some data from a table.

The background: I have extends tx_news with one new field in tca. The data will be saved into the correct database table - but i can't get this content in a viewhelper. To resolve this problem, i want to use the record id from the current news entry to make a mysql call.

But i don't know from where come this id.

For example: newsItem.Id doesn't functional.

1

There are 1 answers

0
lorenz On

The ID from the News is available in Fluid: {newsItem.uid}.

But I would suggest to use the "official" way to extend EXT:news instead of using a complicated hack. You can extend EXT:news easily, see the official documentation.

All you have to do is create a little extension (it could also be your template extension), add the TCA configuration for the field, then add a custom model and tell EXT:news about your model by placing a special text file in your extension.