[TYPO3-english] Templavoila: Adding code via Selectorbox in an FCE

Emiliano Kamppeter gruenbaer at gmx.net
Tue Feb 19 15:26:28 CET 2013


Hi,

I am new to TemplaVoila and trying to create an FCE with different 
Javascript settings for a jQuery based TagCloud. I would like to add 
some Javascript settings by selecting an entry per selector box. Based 
on that entry it should use the corresponding Code.

so, I created a new FCE, mapped root and created an "Not mapped" Element 
and named it field_selector.
In the form I entered 6 options, and in "Data Processing" in "TypoSCript 
Code" I entered something like this:

10 = CASE
10.key.field = field_selector
10.1 = HTML
10.1.value (
      <script type="text/javascript">
		$(document).ready(function(){
			$('#tagoSphere').tagoSphere(s230x142);
		});
	</script>
)
10.2 = HTML
...etc.

Further I created an element with a rich text editor to create an 
unordered List which is converted to tags.

Unfortunately, the tag cloud doesn't work, as the Typoscript/Javascript 
part is completely ignored - the Javascript is not to be found in the 
output.

I have been searching for answers for days now, maybe some nice person 
would be willing to help me out?


Thanks a lot,

Emil

Oh, and here's the content of the XML file (Data Structure) which was 
created:

<?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>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_selector type="array">
				<type>no_map</type>
				<tx_templavoila type="array">
					<title>Select Cloud Size</title>
					<sample_data type="array">
						<numIndex index="0"></numIndex>
					</sample_data>
					<eType>select</eType>
					<TypoScript><![CDATA[
10 = CASE
10.key.field = field_selector
10.1 = HTML
10.1.value (
      <script type="text/javascript">
		$(document).ready(function(){
			$('#tagoSphere').tagoSphere(s230x142);
		});
	</script>
)
10.2 = HTML
10.2.value (
      <script type="text/javascript">
		$(document).ready(function(){
		$('#tagoSphere').tagoSphere(s355x219);
		});
	</script>
)
10.3 = HTML
10.3.value (
      <script type="text/javascript">
		$(document).ready(function(){
		$('#tagoSphere').tagoSphere(s480x296);
		});
	</script>
)
10.4 = HTML
10.4.value (
      <script type="text/javascript">
		$(document).ready(function(){
		$('#tagoSphere').tagoSphere(s304x219);
		});
	</script>
)
10.5 = HTML
10.5.value (
      <script type="text/javascript">
		$(document).ready(function(){
		$('#tagoSphere').tagoSphere(s480x296);
		});
	</script>
)
10.6 = HTML
10.6.value (
      <script type="text/javascript">
		$(document).ready(function(){
		$('#tagoSphere').tagoSphere(s950x294);
		});
	</script>
)
]]></TypoScript>
					<proc type="array">
						<int>0</int>
						<HSC>0</HSC>
						<stdWrap></stdWrap>
					</proc>
					<preview></preview>
				</tx_templavoila>
				<TCEforms type="array">
					<label></label>
					<config type="array">
						<type>select</type>
						<items type="array">
							<numIndex index="0" type="array">
								<numIndex index="0">1/3 (230px) Submenupage</numIndex>
								<numIndex index="1">1</numIndex>
							</numIndex>
							<numIndex index="1" type="array">
								<numIndex index="0">1/2 (355px) Submenupage</numIndex>
								<numIndex index="1">2</numIndex>
							</numIndex>
							<numIndex index="2" type="array">
								<numIndex index="0">2/3 (480px) Submenupage</numIndex>
								<numIndex index="1">3</numIndex>
							</numIndex>
							<numIndex index="3" type="array">
								<numIndex index="0">1/3 (304px) Fullwidth</numIndex>
								<numIndex index="1">4</numIndex>
							</numIndex>
							<numIndex index="4" type="array">
								<numIndex index="0">1/2 (467px) Fullwidth</numIndex>
								<numIndex index="1">5</numIndex>
							</numIndex>
							<numIndex index="5" type="array">
								<numIndex index="0">1/1 (950px) Fullwidth/Feature</numIndex>
								<numIndex index="1">6</numIndex>
							</numIndex>
						</items>
						<default>0</default>
					</config>
				</TCEforms>
			</field_selector>
			<field_tagosphere type="array">
				<tx_templavoila type="array">
					<title>Create an unordered List, each item is a tag.</title>
					<sample_data type="array">
						<numIndex index="0"></numIndex>
					</sample_data>
					<eType>rte</eType>
					<TypoScript><![CDATA[10 = TEXT
10.current = 1
10.parseFunc = < lib.parseFunc_RTE]]></TypoScript>
					<proc type="array">
						<int>0</int>
						<HSC>0</HSC>
						<stdWrap></stdWrap>
					</proc>
					<preview></preview>
					<oldStyleColumnNumber>0</oldStyleColumnNumber>
					<enableDragDrop>1</enableDragDrop>
				</tx_templavoila>
				<TCEforms type="array">
					<label>Create an unordered List, each item is a tag.</label>
					<config type="array">
						<type>text</type>
						<cols>48</cols>
						<rows>5</rows>
						<softref>typolink_tag,images,email[subst],url</softref>
					</config>
				 
<defaultExtras>richtext:rte_transform[flag=rte_enabled|mode=ts_css]</defaultExtras>
				</TCEforms>
			</field_tagosphere>
		</el>
	</ROOT>
</T3DataStructure>


Thanks again ;)




More information about the TYPO3-english mailing list