[TYPO3-english] TS Condition problem dynamic dropdown snippet for countries with Powermailform

Bert Hiddink [BENDOO e-work solutions] hiddink at bendoo.nl
Fri Nov 1 10:26:54 CET 2013


Please look at the snippet below, it gives me a dropdown for 
country-selector in a PM-form, reading from static_countries...Fields 
are stores in fe_users-table.

It works just fine execpt for the renderObj.15.-block.
This part evaluates whether "selected" to the option so that the 
logged-in FE-user can see from the form what country he/she did store 

The problem is with:
   value.data =  TSFE:fe_user|user|country
   equals.field = cn_short_en

This never turns true, however, if I hardcode it ("value =Netherlands"), 
it turns true.

What is wrong with the comparision

Any ideas?

Thanks in advance!

BTW: the value of data= TSFE:fe_user|user|country is printed correctly 
elsewhere in the form...

###Dynamic dropdown for countries with Powermailform
lib.country = CONTENT
lib.country  {
        table = static_countries
        select {
          selectFields = uid, cn_short_en
          pidInList = 0
          orderBy = cn_short_en
        renderObj = COA
        renderObj {
                10 = TEXT
                10.field = cn_short_en
                10.wrap= <option value="|"

                15 = TEXT
                15.value =
                15.noTrimWrap=| selected|
                15.if {
                  value =Netherlands
#                 value.data =  TSFE:fe_user|user|country
                  equals.field = cn_short_en

                20 = TEXT
                20.field = cn_short_en

        wrap (
              <div id="powermail_fieldwrap_{$fieldIdPM}" 
class="powermail_fieldwrap powermail_fieldwrap_select 
                <label for="powermail_field_country" 
class="powermail_label">País &#124; Country</label>
                <select name="tx_powermail_pi1[field][{$fieldIdPM}]" 
class="powermail_field powermail_select" id="powermail_field_country">

More information about the TYPO3-english mailing list