[TYPO3-extbase-kickstarter] Problems with Extbase/Fluid: trying to combine data over 2 tables

Steffen Liebig steffen.liebig at gmx.de
Mon Oct 15 14:38:51 CEST 2012


Hello there everyone,

I'm trying to develop an own extension to show club data separating 
clubs into a by-district-list. Therefore I made up two tables - one for 
the clubs (called "Vereine") and one for the districts (called 
"Kategorie") - plus a 1:n-relation meaning that every club can be in an 
exactly one district (surely many clubs in the same district as well).

Additionally, there's a backward relation as well. Dont know why, I 
meanwhile use it to add the clubs directly into the district. Both is 
also shown up separately in the backend.

The output via frontend should show up like this:

District I            District II/III     District IV.....V.....VI
Thistown
Therevillage

but the best I get is this:

Tx_Clubdaten_Domain_Model_Kategorie:4     Thistown
Tx_Clubdaten_Domain_Model_Kategorie:3     Therevillage
.
.
.

So the result means that the extension only selects and shows the uiD of 
the category (suiting query can't be found), not it's name and not in 
the least as a separated list.

Copying the list-function from one controller to the other to extend the 
"clubs"-controller failed into a warning. Unfortunately, as a 
non-programmer, I gotta few problems with the way things are handled via 
this new concept (controller, database, classes etc). Maybe that's a 
part of the reason - none of my "deeper programming attempts" works.

I also tried out a few ways of taking the district's name as a headline 
to solve the problem, the results can be looked up at 
http://www.pfaelzischer-schachbund.de/typo3/index.php?id=38:

(from left to right)

I) groupedFor:

<td>Bezirk I (Kaiserslautern)</br></br>
<f:groupedFor each="{vereine.vereinsname}" as="clubs" 
groupBy="{vereine.kategorie}" groupKey="{vereine.kategorie}">
           <tr>
              <th>{vereine.kategorie}</th>
           </tr>
     <f:for each="{clubs}" as="club">
     <f:link.action action="show" arguments="{vereine : 
vereine}">{vereine.vereinsname}</f:link.action></br>
       </f:for>
     </f:groupedFor>
     </td>

...shows NOTHING.

II) if condition:

<td>Bezirk II/III (Nord-Ost)</br></br>
          <f:for each="{vereines}" as="vereine">
              <f: if condition="{0:vereine.kategorie} == {0:'1'}">
               <f: then><f:link.action action="show" arguments="{vereine
               : vereine}"> {vereine.vereinsname}</f:link.action>
               </br></f: then>
               <f: else> Keine Vereine in Kategorie 1 !</f: else>
             </f: if>
          </f:for>
       </td>

...shows TOO MUCH (everything from the condition, even if it is a club 
from district I), the code of the end tags coming up in RED letters 
(where's the mistake ?!)

III) double "for each":

<td>Bezirk IV (Landau)</br></br>
       <f:for each="{vereine.kategorie}" as="kategorie"> 
{vereine.kategorie}
        <f:for each="{vereines}" as="vereine">
         <!--<f:link.action action="show" arguments="{vereine : 
vereine}"> {vereine.kategorie}</f:link.action>-->
             <f:link.action action="show" arguments="{vereine : 
vereine}"> {vereine.vereinsname}</f:link.action></br>
         </f:for>
       </f:for>
     </td>

...shows NOTHING.


Even more unfortunately, I don't find a suiting extension for these 
needs which means I have to make it up on my own. Does anyone have an 
idea of how I can tell my extension to show a list of the specified kind ?

Thx very much

Steffen


More information about the TYPO3-project-extbase-kickstarter mailing list