---
title: "Attribut Feld in DS setzen"
url: "https://www.typo3.net/d/73188-attribut-feld-in-ds-setzen"
source: "typo3.net"
tags: ["Archiv","TemplaVoilà","Frage"]
created: "2008-02-01"
last_reply: "2008-03-06"
replies: 3
solved: false
page: 1
pages: 1
lang: "de"
---

# Attribut Feld in DS setzen

Archiv › TemplaVoilà · 3 Antworten · gestartet 2008-02-01

## Eröffnungsbeitrag

**Jeff_s** · 2008-02-01 · [Beitrag #1](https://www.typo3.net/d/73188-attribut-feld-in-ds-setzen/1)

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.

```typoscript
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:

```typoscript
<?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>
```

## Antworten

### [#2](https://www.typo3.net/d/73188-attribut-feld-in-ds-setzen/2) · Jeff_s · 2008-02-06

Lösung:

TS Code für das Attribut-Feld:

```typoscript
<TypoScript>
	<![CDATA[
  		10 = TEXT
		10.field = field_image1
		10.wrap = position:absolute;height:441px;width:441px;background:url(fileadmin/templates/main/images/layout/|) no-repeat;top:-30px;left:-30px;
	]]>
</TypoScript>
```

TS Code für das Bild-Feld:
Also hier muss im Grunde nur mein abgeänderter Code wieder raus

```typoscript
<TypoScript>
	<![CDATA[
        10 = IMAGE
        10.file.import = uploads/tx_templavoila/
        10.file.import.current = 1
        10.file.import.listNum = 0
	]]>
</TypoScript>
```

### [#3](https://www.typo3.net/d/73188-attribut-feld-in-ds-setzen/3) · Arnie2001 · 2008-03-06

> **Jeff_s schrieb:**
>
> Lösung:
>
> TS Code für das Attribut-Feld:
>
> ```typoscript
> <TypoScript>
> 	<![CDATA[
>   		10 = TEXT
> 		10.field = field_image1
> 		10.wrap = position:absolute;height:441px;width:441px;background:url(fileadmin/templates/main/images/layout/|) no-repeat;top:-30px;left:-30px;
> 	]]>
> </TypoScript>
> ```
>
> TS Code für das Bild-Feld:
> Also hier muss im Grunde nur mein abgeänderter Code wieder raus
>
> ```typoscript
> <TypoScript>
> 	<![CDATA[
>         10 = IMAGE
>         10.file.import = uploads/tx_templavoila/
>         10.file.import.current = 1
>         10.file.import.listNum = 0
> 	]]>
> </TypoScript>
> ```

Könntest du bitte mal den kompletten fertigen Code deiner XML-Datei posten?

Wäre echt nett von dir!

Gruß und Danke

### [#4](https://www.typo3.net/d/73188-attribut-feld-in-ds-setzen/4) · Jeff_s · 2008-03-06

```typoscript
<?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>input</eType>
					<TypoScript>
						
							10 = TEXT
							10.field = field_image1
							10.wrap = position:absolute;height:441px;width:441px;background:url(uploads/tx_templavoila/|) no-repeat;top:-30px;left:-30px;
						
					</TypoScript>
				</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
							</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>
			<field_header type="array">
				<tx_templavoila type="array">
					<title>Header</title>
					<sample_data type="array">
						<numIndex index="0">[Header]</numIndex>
					</sample_data>
					<eType>input</eType>
					<TypoScript>
						
							10 = TEXT
							10.data = register:tx_templavoila_pi1.parentRec.header
						
					</TypoScript>
					<proc type="array">
						<HSC type="integer">0</HSC>
					</proc>
				</tx_templavoila>
			</field_header>
		</el>
	</ROOT>
</T3DataStructure>
```

Bitte schön

---

Quelle: „Attribut Feld in DS setzen“, typo3.net, https://www.typo3.net/d/73188-attribut-feld-in-ds-setzen
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
