2017-04-26 4 views
0

In meiner Erweiterung habe ich versucht, eine IRRE zu machen. Schließlich funktioniert das Backend gut, aber das Frontend ist mein Problem. Ich möchte eine normale flüssige Vorlage verwenden, aber alle Namen, die ich versuche, sind leer.TYPO3 IRRE Fluid Frontend

Also hier der Flüssigkeit:

<h2 class="termin"> 
    {data.header} 
    <f:if condition="{data.tx_examples_noclap} == 1"> 
     <f:then><b class="showFullDrop"></b></f:then> 
    </f:if> 
</h2> 
<f:if condition="{data.tx_examples_noclap} == 1"> 
    <f:then><div class="teaser-full"></f:then> 
    <f:else><div class="teaser-full-show"></f:else> 
</f:if> 
     <div class="text">{data.bodytext}</div> 
     <div class="table"> 
      <table border="1"> 
      {termine} 
      <f:for each="{termine}" as="termin"> 
       <tr> 
        <td>{termin.title}</td> 
        <td>{termin.termin2}</td> 
        <td>{termin.termin3}</td> 
        <td style="background:{termin.farbe}">{termin.platz}</td> 
       </tr> 
      </f:for> 
      </table> 
     </div> 
    </div> 

Hier TypoScript

tt_content.stalla_hp_distribution_termin = COA 
tt_content.stalla_hp_distribution_termin { 
    10 = FLUIDTEMPLATE 
    10 { 
     file = EXT:stalla_hp_distribution/Resources/Private/Template/Termin.html 
     stdWrap.dataWrap = <div id="c{field:uid}" class="termin">|</div>  
    } 
} 

Hier die Controler ..

1.Classes/Domain/Model/Termin.php 

    <?php 
    namespace stalla_hp_distribution\Domain\Model; 

    /** 
    * 
    * 
    * @package stalla_hp_distribution 
    * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later 
    * 
    */ 
    class Termin extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { 
     protected $farbe = NULL; 
     protected $title = NULL; 
     protected $termin2 = NULL; 
     protected $termin3 = NULL; 
     protected $platz = NULL; 

     public function getFarbe(){ 
      return $this->farbe; 
     } 

     public function getTitle(){ 
      return $this->title; 
     } 

     public function getTermin2(){ 
      return $this->termin2; 
     } 

     public function getTermin3(){ 
      return $this->termin3; 
     } 

     public function getPlatz(){ 
      return $this->platz; 
     } 


     public function setFarbe(){ 
      $this->farbe = $farbe; 
     } 

     public function setTitle(){ 
      $this->title = $title; 
     } 

     public function setTermin2(){ 
      $this->termin2 = $termin2; 
     } 

     public function setTermin3(){ 
      $this->termin3 = $termin3; 
     } 

     public function setPlatz(){ 
      $this->platz = $platz; 
     } 
    } 
    ?> 

2. Classes/Domain/Repository/TerminRepository.php 

    <?php 
    namespace stalla_hp_distribution\Domain\Repository; 

    class TerminRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { 
    } 
    ?> 

3. Classes/Controller/TerminController.php 

    <?php 
    namespace stalla_hp_distribution\Controller; 
    /** 
    * TerminController 
    */ 
    class TerminController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController { 
     /** 
     * @var stalla_hp_distribution\Domain\Repository\TerminRepository 
     * @inject 
     */ 
     protected $terminRepository; 
     /** 
     * action list 
     * 
     * @return void 
     */ 
     public function listAction() { 
      $termine = $this->terminRepository->findAll(); 
      $this->view->assign('termine', $termine); 
     } 
    } 

    ?> 

Ich würde mich freuen von Ihnen zu hören.

Mit freundlichen Grüßen Ascawath

Antwort

0

Wenn Sie viele Titel auf einen termin verweisen können, versuchen Sie dies

... 
<div class="text">{data.bodytext}</div> 
    <table border="1"> 
     <f:for each="{termine}" as="termin"> 
      <tr> 
       <f:for each="{termin.title}" as="title" iteration="iterator"> 
        <f:if condition="{iterator.isFirst}"> 
            <td>{title}</td> 
        </f:if> 
       </f:for> 
       ... 
      </tr> 
     </f:for> 
    </table> 
</div> 
+0

Die Steuerung usw. sind richtig, oder? – ascawath

+0

Mein Problem ist die Kommunikation von Controller und Fluid. – ascawath

+0

Also diese Cas funktioniert nicht für mich. – ascawath

0

Sie die DatabaseQueryProcessor nutzen, um die Daten Ihres IRRE zugreifen und es in Ihrem Medium zur Verfügung stellen Vorlage

Hier ist ein Beispiel TS

tt_content.slickcarouselbgimg = FLUIDTEMPLATE 
tt_content.slickcarouselbgimg { 
    templateName = Slickcarouselbgimg 
    templateRootPaths { 
     10 = EXT:slickcarousel/Resources/Private/Templates/ 
    } 

    partialRootPaths { 
     10 = EXT:slickcarousel/Resources/Private/Partials/ 
    } 

    layoutRootPaths { 
     10 = EXT:slickcarousel/Resources/Private/Layouts/ 
    } 

    dataProcessing { 
     20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor 
     20 { 
      table = tx_slickcarouselbgimg 
      pidInList.field = pid 
      where { 
       data = field:uid 
       intval = 1 
       wrap = tt_content=| 
      } 
      orderBy = sorting 
      as = slides 
      dataProcessing { 
       10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor 
       10 { 
        references.fieldName = image 
        as = images 
       } 
      } 
     } 
    } 
} 

Hier könnte man das ganze Setup sehen: https://github.com/misterboe/slickcarousel

+0

Ich habe es versucht. Aber ich kann immer noch keinen Inhalt der IRRE sehen – ascawath

Verwandte Themen