Flexible Content und JavaScript mit eindeutiger id

Autor Nachricht
Verfasst am: 24.04.2008 [12:59]
leuny80

[Themenersteller]
dabei seit: 09.04.2008
Beiträge: 5

Hi,

wie bekomme ich es hin, dass meine Flexible Content Elemente eine eindeutige ID vergeben bekommen. Ebenso soll mit einem onClick die ID an ein JavaScript weiter gegeben werden.

Im Folgenden beispiel id="nr1" dynamisch erzeugen, damit das Javascript bei mehreren Instanzen des Flexible Content Element immer noch läuft.

Php:Zeilennummerierung:  An / Aus

  1. <div class="kategorie">
  2.     <span onClick="choseBox('nr1')">
  3.       Gewerbestandort
  4.     </span>
  5.   </div>
  6.   <div style="width:665px; height:0px; overflow:hidden;" id="nr1">
  7.  
  8.   </div>


danke
Verfasst am: 07.05.2008 [16:34]
ChG

dabei seit: 15.07.2004
Beiträge: 39

Mit einem FlexibleContentElement geht das so in etwas...

Typoscript:Zeilennummerierung:  An / Aus

  1. <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
  2. <T3DataStructure>
  3.         <meta type="array">
  4.                 <langDisable>1</langDisable>
  5.         </meta>
  6.         <ROOT type="array">
  7.                 <tx_templavoila type="array">
  8.                         <title>ROOT</title>
  9.                         <description>Select the HTML element on the page which you want to be the overall container element for the template.</description>
  10.                 </tx_templavoila>
  11.                 <type>array</type>
  12.                 <el type="array">
  13.                         <field_title type="array">
  14.                                 <tx_templavoila type="array">
  15.                                         <title>Title</title>
  16.                                         <sample_data type="array">
  17.                                                 <numIndex index="0"></numIndex>
  18.                                         </sample_data>
  19.                                         <eType>input</eType>
  20.                                         <TypoScript><![CDATA[
  21.                                         10 = TEXT
  22.                                         10.value = <div class="kategorie"><span onClick="choseBox('nr
  23.                                         20 = TEXT
  24.                                         20.data = register:tx_templavoila_pi1.parentRec.uid
  25.                                         30 = TEXT
  26.                                         30.value = ')">
  27.                                         40 = TEXT
  28.                                         40.current = 1
  29.                                         50 = TEXT
  30.                                         50.value = </span></div>
  31.                                         ]]>
  32.                                         </TypoScript>
  33.                                         <proc type="array">
  34.                                                 <HSC type="integer">0</HSC>
  35.                                         </proc>
  36.                                 </tx_templavoila>
  37.                                 <TCEforms type="array">
  38.                                         <config type="array">
  39.                                                 <type>input</type>
  40.                                                 <size>48</size>
  41.                                                 <eval>trim</eval>
  42.                                         </config>
  43.                                         <label>Title</label>
  44.                                 </TCEforms>
  45.                         </field_title>
  46.                         <field_content type="array">
  47.                                 <tx_templavoila type="array">
  48.                                         <title>Inhalt</title>
  49.                                         <sample_data type="array">
  50.                                                 <numIndex index="0"></numIndex>
  51.                                         </sample_data>
  52.                                         <eType>rte</eType>
  53.                                         <TypoScript><![CDATA[
  54.                                         10 = TEXT
  55.                                         10.value = <div style="width:665px; height:0px; overflow:hidden;" id="nr
  56.                                         20 = TEXT
  57.                                         20.data = register:tx_templavoila_pi1.parentRec.uid
  58.                                         30 = TEXT
  59.                                         30.value = ">
  60.                                         40 = TEXT
  61.                                         40.current = 1
  62.                                         40.parseFunc = < lib.parseFunc_RTE
  63.                                         50 = TEXT
  64.                                         50.value = </div>
  65.                                         ]]>
  66.                                         </TypoScript>
  67.                                         <oldStyleColumnNumber type="integer">0</oldStyleColumnNumber>
  68.                                         <proc type="array">
  69.                                                 <HSC type="integer">0</HSC>
  70.                                         </proc>
  71.                                 </tx_templavoila>
  72.                                 <TCEforms type="array">
  73.                                         <config type="array">
  74.                                                 <type>text</type>
  75.                                                 <cols>48</cols>
  76.                                                 <rows>5</rows>
  77.                                                 <softref>typolink_tag,images,email[subst],url</softref>
  78.                                         </config>
  79.                                         <label></label>
  80.                                         <defaultExtras>richtext:rte_transform[flag=rte_enabled|mode=ts_css]</defaultExtras>
  81.                                 </TCEforms>
  82.                         </field_content>
  83.                 </el>
  84.         </ROOT>
  85. </T3DataStructure>


LG

Mein aktuelles Projekt: http://www.worldsgreatestguitarist.com




 
TYPO3 Version 4.2.0 testen

TYPO3 Ver. 4.2.0 testen

Testen Sie die neue TYPO3 Version 4.2.0 kostenlos für einen Monat

TYPO3 Bücher

TYPO3 Workshops


TYPO3 Einführungsschulung
in Berlin:
Montag, 07.07.
in Espelkamp:
Montag, 04.08.

TYPO3 Intensivschulung
in Espelkamp:
Mi., 06.08. - Fr., 08.08.
in Würzburg:
Mo., 18.08. - Mi., 20.08.
in Köln:
Mo., 01.09. - Mi., 03.09.
in Berlin:
Mi., 24.09. - Fr., 26.09.

TYPO3 Extensionschulung
in Berlin:
Mo., 14.07. - Mi., 16.07.
in Espelkamp:
Mo., 11.08. - Mi., 13.08.