[TYPO3-german] Re: Re: Templavoila und ContentElement abhängig von der Existenz einer $_GET Variable

Hendrik h.reimers at neonaut.de
Thu Jan 27 09:25:54 CET 2011


Das was du sucht Olli hab ich schonmal gemacht mit TV. Ich habe mir 
daraus TABs gebaut. So wird je nach GET Variable die entsprechende 
Content Spalte ein/ausgeblendet.

Klar geht das auch anders über AJAX sagen manche, aber um Ladezeiten 
gering zu halten war es so nun notwendig, da die Spalte extrem viel 
beinhaltet :-)

Ach ja... du willst bestimmt wissen wie es geht ne?
nachfolgend die Datenstruktur von TV... wichtig ist dass du nicht 
vergisst die constanten zu setzen...

z.B. hier... {$_CONSTANTS.show_datasheet}
ABER im typoscript nicht im constanten feld, sondern im setup definieren 
!!! ...sprich...

SETUP-TypoScript:
------------------
_CONSTANTS.show_datasheet = {$tv.show_datasheet}

CONSTANTS-TypoScript:
---------------------
   tv.show_datasheet = 0

   [globalVar = GP:tab = 1]
       tv.show_datasheet = 1
   [end]

   [globalVar = GP:tab = 2]
       tv.show_datasheet = 2
   [end]




TEMPLAVOILA-Datenstruktur:
---------------------------

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
	<meta type="array">
		<langChildren type="integer">1</langChildren>
		<langDisable type="integer">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>
			<tags>body</tags>
		</tx_templavoila>
		<type>array</type>
		<el type="array">

			<field_content type="array">
				<tx_templavoila type="array">
					<title>Uebersicht</title>
					<description>Pick the HTML element in the template where you want 
to place the main content of the site.</description>
					<sample_data type="array">
						<numIndex index="0">Lorem ipsum dolor sit amet, consectetuer 
adipiscing elit. Pellentesque porta erat vitae nisl. In hac habitasse 
platea dictumst. Aliquam ac urna. Morbi magna mauris, semper ut, varius 
in, convallis vitae, nulla. Proin massa lorem, mollis eget, rutrum 
vitae, commodo id, risus. Curabitur scelerisque risus eget odio. Proin 
laoreet blandit elit. Aenean varius, sapien laoreet dapibus volutpat, 
risus lorem ornare wisi, lobortis venenatis nisl augue sed purus. Nam 
suscipit viverra justo. Suspendisse tincidunt. Nullam vel quam.</numIndex>
					</sample_data>
					<eType>ce</eType>
					<tags>table:outer,td:inner,div:outer,p,h1,h2,h3,h4,h5</tags>
					<oldStyleColumnNumber type="integer">0</oldStyleColumnNumber>
					<TypoScript_constants>
						<show_datasheet>{$_CONSTANTS.show_datasheet}</show_datasheet>
					</TypoScript_constants>
					<TypoScript><![CDATA[
	5 = COA
	5 {
		10= RECORDS
		10.source.current=1
		10.tables = tt_content
		10.wrap = <!--TYPO3SEARCH_begin--> | <!--TYPO3SEARCH_end-->
	}
	5.if.value = 1
	5.if.isLessThan = {$show_datasheet}

                     ]]></TypoScript>
				</tx_templavoila>
				<TCEforms type="array">
					<config type="array">
						<type>group</type>
						<internal_type>db</internal_type>
						<allowed>tt_content</allowed>
						<size>5</size>
						<maxitems>200</maxitems>
						<minitems>0</minitems>
						<multiple>1</multiple>
						<show_thumbs>1</show_thumbs>
					</config>
					<label>Uebersicht</label>
				</TCEforms>
			</field_content>

			<field_datasheet type="array">
				<tx_templavoila type="array">
					<title>Datasheet</title>
					<sample_data type="array">
						<numIndex index="0"></numIndex>
					</sample_data>
					<eType>ce</eType>
					<tags>table:outer,td:inner,div:outer,p,h1,h2,h3,h4,h5</tags>

					<TypoScript_constants>
						<show_datasheet>{$_CONSTANTS.show_datasheet}</show_datasheet>
						<source>{$_CONSTANTS.mailform_source}</source>
					</TypoScript_constants>
					<TypoScript><![CDATA[
	5 = COA
	5 {
		10 = RECORDS
		10.source.current=1
		10.tables = tt_content
		10.wrap = <!--TYPO3SEARCH_begin--> | <!--TYPO3SEARCH_end-->
	}
	5.if.value = 1
	5.if.equals = {$show_datasheet}

	15 = COA
	15 {
		10 = CONTENT
		10.table = tt_content
		#10.wrap = <!--TYPO3SEARCH_begin--> | <!--TYPO3SEARCH_end-->
		10.select.languageField = sys_language_uid
		10.select.pidInList = {$source}
		10.select.orderBy = sorting
	}
	15.if.value = 2
	15.if.equals = {$show_datasheet}

                     ]]></TypoScript>
					<oldStyleColumnNumber type="integer">1</oldStyleColumnNumber>
				</tx_templavoila>
				<TCEforms type="array">
					<config type="array">
						<type>group</type>
						<internal_type>db</internal_type>
						<allowed>tt_content</allowed>
						<size>5</size>
						<maxitems>200</maxitems>
						<minitems>0</minitems>
						<multiple>1</multiple>
						<show_thumbs>1</show_thumbs>
					</config>
					<label>Datasheet</label>
				</TCEforms>
			</field_datasheet>

			
		</el>
	</ROOT>
</T3DataStructure>


More information about the TYPO3-german mailing list