[TYPO3-english] powermail and writing to custom database

Katja Lampela katja.lampela at lieska.net
Mon Jul 22 12:10:05 CEST 2013


Hi!

I'm trying to create a dynamic form that simultaneously reads values 
from database table and writes new values also after submitting.

I have this recipe database with categories (simple relations) and I 
want the visitors add recipes to this database with powermail (2.x).

I have these fields
1. title
2. info
3. category (relation)


READING THE VALUES FROM RELATION TABLE

I get the categories from database with this:
First in powermail I put a typoscript field lib.category and then in 
typoscript I have:

lib.category = COA_INT
lib.category {
   10 = TEXT
   10.value = <label for="category" class="powermail_label">Choose 
category</label>
   20 = CONTENT
   20.wrap = <select class="powermail_field powermail_select" 
id="powermail_field_category" name ="tx_powermail_pi1[field][category]" 
size="1">|</select>
   20 {
     table = tx_klrecipes_category
     select.pidInList = 187
     select.orderBy= title
     renderObj = COA
     renderObj {
       10 = COA
       10 {
         10 = TEXT
         10.field = uid
         10.wrap = <option value="|">
       }
       20 = TEXT
       20.field = title
       20.wrap = |</option>
     }
   }
}


WRITING THE VALUES TO MAIN TABLE

With this I get the data inserted to database:

plugin.tx_powermail.settings.setup {
    dbEntry {
       # enable or disable db entry for tt_address
       tx_klrecipes_recipe._enable = TEXT
       tx_klrecipes_recipe._enable.value = 1

       tx_klrecipes_recipe {
         title = TEXT
         title.field = recipetitle
         info = TEXT
         info.field = recipeinfo

//But for example this doesn't work:

         category = TEXT
         category.value = lib.category.20.renderObj.10.field

         }
       }
    }
}

The problem is, the relation/category doesn't get saved. Any help to 
right direction is very much appreciated!


-- 
Kind regards,
Katja Lampela
www.lieska.net


More information about the TYPO3-english mailing list