[TYPO3-english] parseFunc_RTE wrongly affects other non-related objects

Prakash spabhat at chandanweb.com
Fri Mar 20 10:01:42 CET 2009


Hi,

I forgot that the file attachment does not work in mailing list.
Here is the data structure used for the FCE:

I hope anyone someone would take a look :)



<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<T3DataStructure>
<meta type="array">
<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>
		</tx_templavoila>
		<type>array</type>
		<el type="array">
			<field_image>
				<tx_templavoila>
						<title>Image</title>
						<sample_data>
								<n0></n0>
						</sample_data>
						<eType>image</eType>
						<TypoScript><![CDATA[
10 = IMAGE
10.file.import = uploads/tx_templavoila/
10.file.import.current = 1
10.file.import.listNum = 0
10.file.maxW = 200
10.params =
						]]></TypoScript>
						<description>Do Not Map!!!</description>
				</tx_templavoila>
				<TCEforms>
						<config>
							<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>Thumb Image</label>
				</TCEforms>
		</field_image>
		<field_image_big>
				<tx_templavoila>
						<title>Big Image</title>
						<sample_data>
								<n0></n0>
						</sample_data>
						<eType>image</eType>
						<TypoScript><![CDATA[
10 = IMAGE
10.file.import = uploads/tx_templavoila/
10.file.import.current = 1
10.file.import.listNum = 0
10.file.maxW = 800
10.file.quality = 100
10.params =
						]]></TypoScript>
						<description>Do Not Map!!!</description>
				</tx_templavoila>
				<TCEforms>
						<config>
							<type>group</type>
							<internal_type>file</internal_type>
							<allowed>gif,png,jpg,jpeg</allowed>
							<max_size>7000</max_size>											
							<uploadfolder>uploads/tx_templavoila</uploadfolder>
							<show_thumbs>1</show_thumbs>
							<size>1</size>
							<maxitems>1</maxitems>
							<minitems>0</minitems>
						</config>
						<label>Big Image</label>
				</TCEforms>
		</field_image_big>
		<field_header>
			<tx_templavoila>
					<title>Product Info</title>
					<sample_data>
							<n0>This is a Info Text...</n0>
					</sample_data>
					<eType>input</eType>
					<TypoScript><![CDATA[
10 = COA
10 {	
	

	# create a DIV tag which holds big image
	40 = COA
	40 {
		10 = TEXT
		10.value = <div style="display:none;" id="bigprod_img_

# use the content element id to create a unique ID for this big image
		30 = TEXT
		30.data = register:tx_templavoila_pi1.parentRec.uid
		30.wrap = |">

		#create Link for the big image
		40 = COA
		40 {
			1 = TEXT
			 1.current = 1
			
			 2 = LOAD_REGISTER
			 2.imageSrc.cobject = IMG_RESOURCE
			 2.imageSrc.cobject.file {
			  import = uploads/tx_templavoila/
			  import.field = field_image_big
			  import.listNum = 0
			  maxW = 800			
			  quality = 100
			 }
			 2.imageSrc.data = TSFE:lastImageInfo|3

			 stdWrap.dataWrap = <a rel="lightbox[product]" 
href="/uploads/tx_templavloila/{register:imageSrc}" title=" | ">
		}		 		
		
		60 = IMAGE
		60.file {
			import = uploads/tx_templavoila/
			import.field= field_image_big
			maxW = 220			
			format = jpg
			quality = 100
		}
		
		70 = TEXT
		70.value = </a>
		
		80 = TEXT
		80.field = field_text
#		80.parseFunc = < lib.parseFunc_RTE
		80.wrap = <div style="margin-top:4px" class="inp_product">|</div>
		
		90 = TEXT
		90.value = </div>
		
		
	}
	
	
	50 = COA
	50 {
		
		10 = TEXT
		10.value = <div class="csc-textpic-text"><p class="align-center"><a 
href="#" onclick="showImage('bigprod_img_		

# use the content element id to refer to unique ID of it's big image
		20 = TEXT
		20.data = register:tx_templavoila_pi1.parentRec.uid
		20.wrap = |');return false;">
		
		30 = IMAGE
		30 {
			file.import = uploads/tx_templavoila/
			file.import.field = field_image						
		}
		
		40 = TEXT
		40.value = </a></p></div>

	}
	
	60 = COA
	60 {
		
		10 = TEXT
		10.value = <div class="csc-textpic-text inp_productname"><p 
class="align-center"><a href="#" class="normal" 
onclick="showImage('bigprod_img_		

# use the content element id to refer to unique ID of it's big image
		20 = TEXT
		20.data = register:tx_templavoila_pi1.parentRec.uid
		20.wrap = |');return false;">
		
		30 = TEXT
         30.current = 1
		30.parseFunc >
		
		40 = TEXT
		40.value = </a></p></div>

	}

}



					]]></TypoScript>
			</tx_templavoila>
			<TCEforms>
					<config>
							<type>input</type>
							<size>48</size>
							<eval>trim</eval>
					</config>
					<label>Product Name</label>
			</TCEforms>
	</field_header>
	<field_text type="array">
		<tx_templavoila type="array">
		<title>Description</title>
		<eType>text</eType>
		<TypoScript>
		  <![CDATA[
			10 = TEXT
			10.current = 1
			10.parseFunc = < lib.parseFunc_RTE
		  ]]>
		</TypoScript>
		<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>
		</config>
		<label>Description</label>
	 
<defaultExtras>richtext[*]:rte_transform[flag=rte_enabled|mode=ts_css]</defaultExtras>
	  </TCEforms>
	</field_text>
</el>	
	</ROOT>
</T3DataStructure>

Regards,
Prakash


Prakash wrote:
> Hi All,
> 
> I feel it would be a real challenge to any typo3 when one tries to read, 
> understand and debug any TypoScript.
> I wrote a similar challenging code using TypoScript itself for an FCE 
> that is used to create a cool image gallery of products.
> 
> In this gallery I have one FCE containing a small image, big image, 
> product name, and product description.
> 
> While mapping this FCE I mapped only the product name field (field_header).
> The field_header uses several TypoScript to create the html output as 
> needed.
> With this Templavoila Data structure, I am able to get everything as 
> needed, almost everything.
> 
> This code however has a major issue, being that the description is not 
> getting parsed through the RTE.
> The corresponding object for description is 10.40.80 = TEXT
> 
> I specified the parse function for this object as follows:
> 10.40.80.parseFunc = < lib.parseFunc_RTE
> 
> Now I could see that the description text gets parsed properly, but 
> surprisingly it is also affecting another object that is:
> 10.60.30 = TEXT
> The above object seems nowhere related to 10.40.80, but still this text 
> is parsed, and links are created for the same!!!
> 
> Can anyone check what am I doing wrong? I have enclosed the entire xml 
> file in the attachment.
> 
> lol
> 


More information about the TYPO3-english mailing list