Hallo,
Ich verzweifele so langsam beim Versuch ein Attribut Feld im TypoScript meiner DS zu setzten.
Also ich habe folgende Felder in meiner DS:
Attribut Feld -> Verbunden mit einem DIV element -> Eigenschaft ATTRIBUTE : "style"(=)
Image Feld -> Kein Mapping
So das Bild möchte ich jetzt gerne als Background-image in das Attribut Feld setzen. Dafür habe ich den Test Code umgeschrieben und in mein TS in der DS eingefügt. Jedoch bekomme ich es nicht hin, dass das Bild angezeigt wird.
Test Code der Haupt TypoScript Template:
Wenn ich den Test Code in meine Haupt TypoScript Template schreibe dann wird das Style Attribut gesetzt.
lib.bgimage = TEXT
lib.bgimage.value = position:absolute;height:441px;width:441px;background:url(fileadmin/templates/main/images/layout/ct_box_clock.png) no-repeat;
Hier die DataStructure in XML Form:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<t3datastructure>
<meta type="array" />
<langdisable>1</langdisable>
</meta>
<root type="array">
<tx_templavoila type="array">
<title>ROOT</title>
<description>Select the HTML element on the page which you want to be the overall container element for the template.</description>
</tx_templavoila>
<type>array</type>
<el type="array">
<field_bgimage type="array">
<type>attr</type>
<tx_templavoila type="array">
<title>Background Image</title>
<description>Map this attribute with the style attribute of the html element containing the background image</description>
<sample_data type="array">
<numindex index="0"></numindex>
</sample_data>
<etype>TypoScriptObject</etype>
<typoscriptobjpath>lib.bgimage</typoscriptobjpath>
</tx_templavoila>
</field_bgimage>
<field_content type="array">
<tx_templavoila type="array">
<title>Content</title>
<description>Map this element to the content element</description>
<sample_data type="array">
<numindex index="0">[Here goes my content. Here goes my content. Here goes my content. Here goes my content]</numindex>
</sample_data>
<etype>rte</etype>
<typoscript><![CDATA[
10 = TEXT
10.current = 1
10.parseFunc = < lib.parseFunc_RTE
]]></typoscript>
<oldstylecolumnnumber type="integer">0</oldstylecolumnnumber>
<proc type="array">
<hsc type="integer">0</hsc>
</proc>
</tx_templavoila>
<tceforms type="array">
<config type="array">
<type>text</type>
<cols>48</cols>
<rows>5</rows>
<softref>typolink_tag,images,email[subst],url</softref>
</config>
<label>Content</label>
<defaultextras>richtext:rte_transform[flag=rte_enabled|mode=ts_css]</defaultextras>
</tceforms>
</field_content>
<field_image1 type="array">
<type>no_map</type>
<tx_templavoila type="array">
<title>Background Image </title>
<sample_data type="array">
<numindex index="0"></numindex>
</sample_data>
<etype>image</etype>
<typoscript>
10 = IMAGE
10.file.import = uploads/tx_templavoila/
10.file.import.current = 1
10.file.import.listNum = 0
10.file.maxW = 200
Abgeänderter Code
20 = TEXT
20.text.field = field_bgimage
20.value = position:absolute;height:441px;width:441px;background:url(fileadmin/templates/main/images/layout/|) no-repeat;
</typoscript>
</tx_templavoila>
<tceforms type="array">
<config type="array">
<type>group</type>
<internal_type>file</internal_type>
<allowed>gif,png,jpg,jpeg</allowed>
<max_size>1000</max_size>
<uploadfolder>uploads/tx_templavoila</uploadfolder>
<show_thumbs>1</show_thumbs>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
</config>
<label>Background Image </label>
</tceforms>
</field_image1>
</el>
</root>
</t3datastructure>