[Typo3] Filling source field of a RECORDS element from a select result

Christopher bedlamhotel at gmail.com
Thu Dec 8 17:24:01 CET 2005


Hi,

On 08/12/05, Raúl Tarrío <webmaster at bracamonte.org> wrote:
> Hi
> I'm newbee at typo3 and I'm in troubles. I try to reference a record
> content as a search result of tt_content. Select result it's Ok, because
> in my web I have a Flexible Content in every page (CType =
> 'templavoila_pi1'), but when I try to assign uid field to source field
> it doesn't work. This is my code:
>
> 10 = RECORDS
> 10 {
>     tables = tt_content
>     dontCheckPid=1
>     select {
>         pidInList.data = TSFE:id
>         where = CType = 'templavoila_pi1'
>     }
>     source.field = uid
>     #doesn´t work
>
>     #source = 459
>     #if I write a particular id, it works
>   }
>
> To check select result it's ok I've done it this way:
>
> 10 = CONTENT
> 10 {
>     table = tt_content
>     dontCheckPid=1
>     select {
>         pidInList.data = TSFE:id
>         where = CType = 'templavoila_pi1'
>     }
>     renderObj = TEXT
>     renderObj.field = uid
>   }
>
> this prints 459, the content identifier that is into one particular
> page, I mean which I want to put in source field.
>
> ¿Any idea?


No time to write it out or test it, but if you check the TSref [1],
you'll find that the '.source' property of RECORDS has .stdWrap...Try
something like this:

.source.cObject = CONTENT
.source.cObject {
  ### Use the same TS as you've used in your msg above in this
spot...this will return the id of the record to the .source property
of the RECORDS object
}

As I say, I haven't tested this, but I think it should work.


-Christopher


[1] http://typo3.org/documentation/document-library/doc_core_tsref/RECORDS/



More information about the TYPO3-english mailing list