[TYPO3-templavoila] Section as direct child of section possible?

Uschi Renziehausen typo3news at otherone.de
Tue Feb 27 23:16:11 CET 2007


Hello list,

I need a helping hand or two with a problem I have not been able to 
solve after two days of fiddling and reading around. I cannot get it right.

What I want to build, is an FCE with
- 1 header (h3) with a link inside (no problem)
- a variable amount of UL elements on the same level (problem no 1)
- the first of those lists needs a class attribute


My first thought was: Well, if you want repetitive elements you need a 
Container-Section (SC) mapped to a DIV-element containing all the 
UL-elements, and then I need two SCs, one for the first list and one for 
all the other lists. My html-code looks like this:

<div id="fce-wrapper">
   <h3><a href="#">Some label</a></h3>

   <div id="section-wrapper">
     <ul class="first">
       <li class="internal-link"><a href="#">Label</a></li>
       <li class="external-link"><a href="#">Label</a></li>
       <li class="download"><a href="#">Label</a></li>
     </ul>

     <ul>
       <li class="internal-link"><a href="#">Label</a></li>
       <li class="external-link"><a href="#">Label</a></li>
       <li class="download"><a href="#">Label</a></li>
     </ul>

     <ul>
       <li class="internal-link"><a href="#">Label</a></li>
       <li class="external-link"><a href="#">Label</a></li>
       <li class="download"><a href="#">Label</a></li>
     </ul>
   </div>
</div>

The relevant part of the mapping:

field_list_container: mapping type = "Container for elements" with 
Section-checkbox checked and mapped to div#section-wrapper, mode is outer

field_first_list: mapping-type as above, mapped to ul.first, inner

Inside field_first_list I have three COs, one for each class.

While I did the mapping TV did not complain about anything, but 
unfortunately the BE-form does not work as intended. This is what happens:

- When the form first appears, I see the List Container and choose NEW: 
First list and save.
- When the form reappears, i have my first list and can choose "Internal 
link", "External link" and "Download". I choose e.g. "Internal Link" and 
save.
- :-((( My First list is gone. The last Element I see, is the List 
Container.

I am not sure anymore, whether SC is allowed as direct child of SC in 
TV, because looking up <type> in "the TV-Docs [1] I found the remark:
<type>array</type> + <section>1</section> = Renders a section which must 
contain other array-types (without <section> set!)

But on the other hand, SC-grandchildren are obviously allowed if they 
are on a deeper level. At least I followed the 2 level FCEs example in 
the wiki [2], and that one worked.

[1] 
http://typo3.org/documentation/document-library/extension-manuals/templavoila/1.3.0/view/1/5/
[2] http://wiki.typo3.org/index.php/TemplaVoila#2_level_FCEs

Can someone please give some instruction how to get it right, thus 
preventing me from eating my keyboard? As a workaround I could perhaps 
force my editors to enter every list as a separate content element, but 
I do not like that idea out of several reasons and I really would like 
to know, whether such an FCE is possible or not, and if it is, then how.

Uschi


More information about the TYPO3-project-templavoila mailing list