[TYPO3] TYPOSCRIPT: database driven selector

Nikolas Hagelstein hagelstein at shr.cc
Mon Sep 3 10:47:27 CEST 2007


Hi there,

I just created a DAM category selector and i wonder if there is a more
elegant(pure TS) way to solve this issue.
Especially the "SELECTED" part seems a little odd to me.

-------
10 = COA_INT
10 {
  stdWrap.dataWrap = <form action="index.php?id={TSFE:id}"
method="post">|</form><br /><br />
  10 = CONTENT
  10.wrap = <select name="tx_fmApp[cat1]"
onChange="this.form.submit()"><option value="0">Choose</option>|</select>
  10.table = tx_dam_cat
  10.select {
    pidInList = 66
    orderBy = sorting
    andWhere = parent_id=
    andWhere.dataWrap = |6 	
  }  
  10.renderObj =COA
  10.renderObj {
    10 = TEXT
    10.value = <option value="{field:uid}" 
    10.insertData = 1
    20 = TEXT
    20.noTrimWrap =| SELECTED|
    20.if.value.data=GPvar:tx_fmApp|cat1 
    20.if.equals.field=uid
    30 = TEXT
    30.field = title
    30.wrap = >|</option>|
  }
}
---------

Cheers,
NIkolas


More information about the TYPO3-english mailing list