chris
chris

Reputation: 2243

TYPO3: Howto show records from a folder outside the page tree

In my TYPO3 installaion I have configured two websites in two separate page trees. Now I would like to show a record of a custom extension in website A but the record is stored in the page tree of website B.

This is the showAction in my controller:

public function showAction(\Vendor\Extension\Domain\Model\Event $event)
{
    $this->view->assign('event', $event);
}

In the repository I disabled the storage page restriction with the following lines of code:

class EventRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
    public function initializeObject()
    {
        $querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
        $querySettings->setRespectStoragePage(false);
        $this->setDefaultQuerySettings($querySettings);
    }
}

Showing a record on website A which is stored in the page tree of website A, works without any problems. But as soon as I try to load a record of the page tree of website B on website A it fails.

So is it possible to show records which are stored outside of the page tree?

Upvotes: 0

Views: 348

Answers (1)

Jonas Eberle
Jonas Eberle

Reputation: 2921

Your EventRepository has nothing to do with the parameter resolving for the showAction(). This should just work when given an uid of an event.

I suspect you also use routeEnhancers and maybe you chose 'eval: uniqueInSite' for the slug configuration? - in that case try without routeEnhancers to verify.

Upvotes: 2

Related Questions