My Problem: I'm using the a21_glossary extension. It has everything i need, except
that the glossary page lists all entries in a row without dividing between letters
NATO
Description text
UNO
Description text
WWF
Description text
What i want is
N
NATO
Description text
U
UNO
Description text
W
WWF
Description text
So what i did was to modify the extension class. In this class there is a loop through all glossar entries
In every loop i pick the first letter and compare if it has changed compared to the last loop. Then i:
if ($currentFirstLetter != $lastFirstLetter) {
$row['first_letter'] = $currentFirstLetter;
} else {
unset($row['first_letter']);
}
Shortly after that the $row array is assigned to the cObj:
$cObj->data = $row;
So far everythings fine. I would expect the first_letter var to be accessible in the typoscript section, which is:
tx_a21glossary_main = COA
tx_a21glossary_main {
10 = TEXT
10.if.isTrue.field = first_letter
10.field = first_letter
10.wrap = <h2>|</h2>
20 = TEXT
20.if.isTrue.field = short
20.field = short
20.wrap = {$a21glossary.shortWrap}
30 = COA
30.wrap = {$a21glossary.restWrap}
30 {
10 = TEXT
10.if.isTrue.field = description
10.field = description
10.wrap = {$a21glossary.descriptionWrap}
}
}
But it seems the "first_letter" field is not the field of the array handed over to the cObj, but rather the database column, since the "if.isTrue" doesn't work for "first_letter"...