Beispiel #1
0
 /**
  * Create a StandaloneView for the ContentObject.
  *
  * @return \TYPO3\CMS\Fluid\View\StandaloneView
  */
 protected function createStandaloneView()
 {
     $extensionKey = $this->settings['extensionKey'];
     $name = $this->settings['contentElement'];
     $templatePath = 'EXT:' . $extensionKey . '/Resources/Private/Templates/Content/' . $name . '.html';
     return ExtendedUtility::createExtensionStandaloneView($extensionKey, $templatePath);
 }
 /**
  * Render the Backend Preview Template and return the HTML.
  *
  * @param array $row
  *
  * @return string
  */
 public function getBackendPreview($row)
 {
     if (!$this->hasBackendPreview($row)) {
         return '';
     }
     $ctype = $row['CType'];
     /** @var array $config */
     $config = $GLOBALS['TYPO3_CONF_VARS']['AUTOLOADER']['ContentObject'][$ctype];
     $model = ModelUtility::getModel($config['modelClass'], $row, true);
     $view = ExtendedUtility::createExtensionStandaloneView($config['extensionKey'], $config['backendTemplatePath']);
     $view->assignMultiple(['data' => $row, 'object' => $model]);
     return $view->render();
 }