简体   繁体   English

TYPO3 IRRE流体前端

[英]TYPO3 IRRE Fluid Frontend

In my extension I tried to make an IRRE. 在我的扩展程序中,我尝试创建IRRE。 Finally the Backend works fine but the frontend is my problem. 最后,后端工作正常,但是前端是我的问题。 I want to use a normal fluid template but all names I try are empty. 我想使用普通的流体模板,但我尝试输入的所有名称均为空。

So here the fluid: 所以这里的流体:

<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>

Here the typoScript 这是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>    
    }
}

Here the 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);
        }
    }

    ?>

I'm looking forward to hearing from You. 我期待着您的回音。

Kind Regards Ascawath 问候Ascawath

If you can reference many titles to a termin, try this 如果您可以在术语中引用许多标题,请尝试以下操作

...
<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>

You could use the DatabaseQueryProcessor to access the Data of your IRRE and make it available in your Fluid Template 您可以使用DatabaseQueryProcessor访问IRRE的数据并将其在Fluid模板中使用

Here is an Example TS 这是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
                }
            }
        }
    }
}

Here you could see the whole setup: https://github.com/misterboe/slickcarousel 在这里您可以看到整个设置: https : //github.com/misterboe/slickcarousel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM