[TYPO3-english] TemplaVoila: Background of "container for element"

jaco graaff jaco at spacexplorer.co.za
Thu Sep 29 00:41:06 CEST 2011


I'm having difficulty setting a background of a "wrapping" parent container 
of a repeating block in FCE

QUESTION 1: I'm trying to follow this tutorial...

http://spabhat.wordpress.com/2008/10/24/set-background-image-from-an-image-field/

in their example their wrapping block has a

<eType>ce</eType>

classification

while mine has

<eType>input</eType> for the CO - repeating block

I don't seem to have a way to declare ce for a parent container??

my layout looks as follows:

CO - ROOT - div [inner]
--- SC - field_container - div [inner] (wrap the all the repeating 
containers)
------ CO - field_infopanel - div (wrap single - this is the element that 
will repeat with its content)
---------EL - field_title
---------EL - field_image
---------EL - field_description
---------AT - field_link - this maps to an
---------AT - field_background - this has to map to the CO - field_infopanel 
style:background

QUESTION 2:

if I could in some way target the field_infopanel CO then I could also maybe 
change its class attribute:
hopefully with something like this

wrapItemAndSub = <div class="infoPanel first">|</div> |*| <div 
class="infoPanel middle">|</div> |*| <div class="infoPanel last">|</div>

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TRY 1:

in the CO - field_infopanel  section of the FCE xml I add a field like

<TypoScriptObjPath>lib.infoPanelContainer</TypoScriptObjPath>

so that I can target the object through typoscript selector later (although 
this is going to be a repeating object)

in the section for the background image selector i then somehow bind the 
background to the lib.infoPanelContainer


lib.infoPanelContainer = COA
lib.infoPanelContainer{
10 = TEXT
10.field = field_backgroundimage
10.wrap = background-image:url(/uploads/tx_templavoila/|)
}


RESULT: did not work
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TRY 2:


I tried to do all the binding magic in the typoscript under the

------ CO - fieldInfoPanel

node

like this:
--------------------------------------------------------------------- 
                <el type="array">
                        <field_container type="array">
                                <type>array</type>
                                <tx_templavoila type="array">
                                        <title>infoPanelContainer</title>
                                        <eType>input</eType>
                                        <!--<TypoScriptObjPath>lib.infoPanelContainer</TypoScriptObjPath> 
 -->
<TypoScript>
<![CDATA[
renderObj = COA
renderObj {
10 = TEXT
10.field = field_background ##this is referal to the node for selecting the 
image
10.wrap =  background-image:url(/uploads/tx_templavoila/|)
}


--------------------------------------------------------------------- 

where "field_background" is the node for selecting the background image


To add the typoscript I am editing the FCE xml file -

I might be making a huge mistake since the CO element does not have an entry 
for typoscript in the typo3 backend

- it seems it only has one if it is an element or attribute, etc...

my inspiration comes from:
http://lists.typo3.org/pipermail/typo3-project-templavoila/2007-March/002014.html
http://lists.typo3.org/pipermail/typo3-project-templavoila/2007-April/002116.html

it might be that the solution is to add another div inside the repeating 
object and target that instead of the parent div

then i can map the div as an element which might accept the code

But in that way I'll have messy html


RESULT: didn't get it to work
------------------------------------------------------------------------
TRY 3:

according:


##http://lists.typo3.org/pipermail/typo3-project-templavoila/2007-April/002117.html


the node is already a COA

so I should only use:



10 = TEXT
10.field = field_backgroundimage
10.wrap = background-image:url(/uploads/tx_templavoila/|)



still does not work




anyway - I've been struggling with this for 6 hours now -
------------------------------------------------------------------------



Jaco 



More information about the TYPO3-english mailing list