0
votes

I have a problem loading content from an external extension with fluid. I want to load all selected news entries.

If I debug my fluid, I receive the following data: uid = 2 / pid = 7

But nothing more like title, bodytext, …

Is there a way to render the content with fluid and/or VHS viewhelper? I need to get all information of the selected News entries.

The record is coming from the extension „news“ and should show the title and description from the news entry.

In my Backend TCA I access the news entries via:
'foreign_table' => 'tx_news_domain_model_news',
'MM' => 'tx_news_domain_model_news_ttcontent_mm',

But in my Frontend-Rendering I have only access to the news „uid“ and „pid“ but nothing more.
My Fluid code looks like:

<f:for each="{entries}" as="entry">
    <f:for each="{entry.news}" as="news">
        ### HERE is only the access to the uid and pid ########
    </f:for>
</f:for>

I passed the entries in my Controller (Classes/Controller) with:

$entries = $this->entriesRepository->findAll();
$this->view->assign('entries', $entries);

I’ve created my own extension and I want to get access to the entries of the extension „news“.

1
You might want to give a bit more information. Where is the record coming from? Perhaps share the relevant code. - Rudy Gnodde
Many thanks for your fast response. I've updated the the question to give more information. - A.Tietz
How are the entries passed to Fluid? Are you using a plugin? TypoScript? Are you using your own models? - Rudy Gnodde
Sorry for the unclear question ... I've updated it again. - A.Tietz

1 Answers

1
votes

I'm assuming you have a model for the entry records where news is a property and you have your own model for the news records. If so, you need make sure your news model extends the model from the news extension. That way all fields will be available.

So in your entry model you will have something like:

/*
 * News
 *
 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Your\Extension\Domain\Model\News>
 */
protected $news;

And your news model class is defined as:

namespace Your\Extension\Domain\Model;

class News extends \GeorgRinger\News\Domain\Model\News {

You can also link directly to the model from the news extension in your entry model if you don't extend news. That way you don't need your own news model:

/*
 * News
 *
 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\GeorgRinger\News\Domain\Model\News>
 */
protected $news;