[TYPO3-english] Dynamic Database query using TypoScript

Miroslav Monkevic mironas at gmail.com
Tue Oct 14 08:14:28 CEST 2008


Hi, All,

Another option, using TEXT element:

lib.code=TEXT
lib.code {
  data = GPvar:tx_wecstaffdirectory_pi1|curstaff
  required = 1
  wrap = {DB:tx_wecstaffdirectory_info:|:position_title}
  insertData = 1
}

Peter Klein wrote:
> Hi Valter.
> It's not possible using the "DB:table:uid:field" setup, but you can do it 
> using a CONTENT element.
>
> Something like this. (Untested, as I don't have the ext you are using 
> installed)
>
> -- cut --
> lib.code = COA_INT
> lib.code {
>   10 = CONTENT
>   10.table = tx_wecstaffdirectory_info
>   10.select.pidInList = #Insert Id of page where you store your records
>   10.select.andWhere.data = GPvar:tx_wecstaffdirectory_pi1|curstaff
>   10.select.andWhere.wrap = uid=|
>   10.renderObj = TEXT
> #  10.renderObj.data = debug:data
>   10.renderObj.field = position_title
>   10.renderObj.wrap = Title = |<br>
>   if.isTrue.data = GPvar:tx_wecstaffdirectory_pi1|curstaff
> }
> -- cut --
>
> Using a CONTENT element, you have access to ALL fields of the selected 
> record(s) in the renderObj
> You can try commenting out the 10.renderObj.field = position_title line, and 
> remove the comment on the line abowe. That will show you all the available 
> fields.
>
> --
> Peter Klein
>
>   

-- 
Best regards,
Miroslav Monkevic




More information about the TYPO3-english mailing list