Return to Snippet

Revision: 19962
at November 4, 2009 08:20 by quadratliter


Updated Code
#####################################################
## Typoscript in the main template
#####################################################
temp.content_Img = COA
temp.content_Img {
    10 = HTML
    10 {
        value.field = field_img #name des feldes im tv xml
        value.split {
            token = ,
            cObjNum = 1
            1 {
                10 = IMAGE
                10 {
                    file {
                        import.current = 1
                        import = uploads/tx_templavoila/
                        format = jpg
                        width = 245c
                        height = 155c
                    }
                }
            }
        }
    }
}
lib.contentImgNorm = COA
lib.contentImgNorm {
    10 < temp.content_Img
}

#####################################################
## adjustments in the TemplaVoil�  DataStructure XML
#####################################################
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
	<meta type="array">
		<langDisable>1</langDisable>
	</meta>
	<ROOT type="array">
		<tx_templavoila type="array">
			<title>ROOT</title>
			<description>Multiple Images</description>
		</tx_templavoila>
		<type>array</type>
		<el type="array">
			<field_img type="array">
				<tx_templavoila type="array">
					<title>Bilder</title>
					<sample_data type="array">
						<numIndex index="0"></numIndex>
					</sample_data>
					<eType>imagefixed</eType>
					<tags>*:inner</tags>
					<TypoScriptObjPath>lib.contentImgNorm</TypoScriptObjPath>
				</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>5</size>
						<maxitems>15</maxitems>
						<minitems>0</minitems>
					</config>
					<label>Bilder</label>
				</TCEforms>
			</field_img>
		</el>
	</ROOT>
</T3DataStructure>

Revision: 19961
at November 4, 2009 08:18 by quadratliter


Initial Code
#####################################################
## Typoscript in the main template
#####################################################
temp.content_Img = COA
temp.content_Img {
    10 = HTML
    10 {
        value.field = field_img #name des feldes im tv xml
        value.split {
            token = ,
            cObjNum = 1
            1 {
                10 = IMAGE
                10 {
                    file {
                        import.current = 1
                        import = uploads/tx_templavoila/
                        format = jpg
                        width = 245c
                        height = 155c
                    }
                }
            }
        }
    }
}
lib.contentImgNorm = COA
lib.contentImgNorm {
    10 < temp.content_Img
}

#####################################################
## adjustments in the TemplaVoilà DataStructure XML
#####################################################
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
	<meta type="array">
		<langDisable>1</langDisable>
	</meta>
	<ROOT type="array">
		<tx_templavoila type="array">
			<title>ROOT</title>
			<description>Multiple Images</description>
		</tx_templavoila>
		<type>array</type>
		<el type="array">
			<field_img type="array">
				<tx_templavoila type="array">
					<title>Bilder</title>
					<sample_data type="array">
						<numIndex index="0"></numIndex>
					</sample_data>
					<eType>imagefixed</eType>
					<tags>*:inner</tags>
					<TypoScriptObjPath>lib.contentImgNorm</TypoScriptObjPath>
				</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>5</size>
						<maxitems>15</maxitems>
						<minitems>0</minitems>
					</config>
					<label>Bilder</label>
				</TCEforms>
			</field_img>
		</el>
	</ROOT>
</T3DataStructure>

Initial URL

                                

Initial Description
The snippet is splitted in two parts. One in the main template and one in the Templavoila DataStructure XML field. In the TypoScript part the value of the TV field is splitted by "," and the cObj 1 is adapted to the current value. you could also use split options like 1 |*| 2 |*| 3. In this case the first image will be processed in cObj 1 the last in cObj 3 and all images between in cObj 2.

The only limit how much images you can use is the limit in the TV DS, in this expamle is set the <size> to 5 and <maxitems> to 15.

Initial Title
Multiple Images in one TemplaVoilà field

Initial Tags

                                

Initial Language
TYPO3