title: How to use custom records in fluid powered typo3 content element
body: <p>a few days ago I started using TYPO3 8.7.7 and I created a small website using Fluid powered TYPO3 extensions. Now I want to create a
  custom content element that displays a few products that the editor can manage in the backend. In my extension I created a simple model
  for the products:</p>
  
  <pre><code>namespace Something\Products\Domain\Model;
  
  use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
  
  class Product extends AbstractEntity
  {
  
      protected $name;
  
      protected $description;
  
      public function __construct(string $name, string $description)
      { ... }
  
      public function getName(): string
      { ... }
  
      public function setName(string $name)
      { ... }
  
      public function getDescription(): string
      { ... }
  
      public function setDescription(string $description)
      { ... }
  }
  </code></pre>
  
  <p>I also created a ProductRepository class that simply extends \TYPO3\CMS\Extbase\Persistence\Repository.</p>
  
  <p>In EXT:something/Configuration/TCA/tx_product.php</p>
  
  <p>I have the following definition:</p>
  
  <pre><code>return [
      'ctrl' =&gt; [
          'title' =&gt; 'Products',
          'label' =&gt; 'name'
      ],
  
      'columns' =&gt; [
          'name' =&gt; [
              'label' =&gt; 'Name',
              'config' =&gt; [
                  'type' =&gt; 'input',
                  'eval' =&gt; 'trim,required',
              ],
          ],
          'description' =&gt; [
              'label' =&gt; 'Description',
              'config' =&gt; [
                  'type' =&gt; 'text',
                  'eval' =&gt; 'trim,required',
              ],
          ],
      ],
  
      'types' =&gt; [
          '0' =&gt; ['showitem' =&gt; 'name, description'],
      ],
  ];
  </code></pre>
  
  <p>Adding and editing products is working great in Web->List Module. I store them in a folder in the page tree called Products.</p>
  
  <p>My goal is it to create a content element called Products to a page in an arbitrary column. The template in the frontend should display a
  list of products.</p>
  
  <p>I would expect something like this in my EXT:something/Resources/Private/Template/Content/Product.html</p>
  
  <pre><code>&lt;div xmlns="http://www.w3.org/1999/xhtml" lang="en"
      xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
      xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers"
      xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"&gt;
  
      &lt;f:layout name="Content"/&gt;
  
      &lt;f:section name="Configuration"&gt;
          &lt;flux:form id="newsitem" options="{group: 'Unicontrol'}"&gt;
              &lt;flux:field.input name="settings.headline" required="true"/&gt;
          &lt;/flux:form&gt;
      &lt;/f:section&gt;
  
      &lt;f:section name="Main"&gt;
          &lt;ul&gt;
              &lt;f:for each="{products}" as="product"&gt;
                  &lt;li&gt;{product.name}&lt;/li&gt;
              &lt;/f:for&gt;
          &lt;/ul&gt;
      &lt;/f:section&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now I don't know how I can do that. I think I need a controller class but I can't figure out how to connect it with my Fluid powered TYPO3
  Templates/Partials. Can anyone help me to find a way to realise this?</p>
  
  <p>Thanks in advance and have a nice day.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>My current CE template looks like this now:</p>
  
  <pre><code>&lt;div xmlns="http://www.w3.org/1999/xhtml" lang="en"
      xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
      xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers"
      xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"&gt;
  
      &lt;f:layout name="Content"/&gt;
  
      &lt;f:section name="Configuration"&gt;
          &lt;flux:form id="products" options="{group: 'Unicontrol'}"&gt;
              &lt;flux:field.relation name="settings.relation" table="tx_products_domain_model_product"
                                  transform="TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage&lt;Something\\Products\\Domain\\Model\\Product&gt;"
                                  multiple="true"/&gt;
          &lt;/flux:form&gt;
      &lt;/f:section&gt;
  
      &lt;f:section name="Main"&gt;
          &lt;ul&gt;
              &lt;f:for each="{settings.relation}" as="product"&gt;
                  &lt;li&gt;{product.name}&lt;/li&gt;
              &lt;/f:for&gt;
          &lt;/ul&gt;
      &lt;/f:section&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I can now select one product of my list in the CE but in the frontend it only displays one element, the element I selected in the backend.
  It doesn't matter if I escape the slashes or not.</p>