[TYPO3] Adding page content dynamically

Dmitry Dulepov typo3 at accio.lv
Wed Sep 13 19:33:42 CEST 2006


Tomas Mrozek wrote:
> OK, I almost got there:
> ----------------------
> 
> subparts.MYMARKER = COA
> subparts.MYMARKER.10 < styles.content.get
> 
> [globalVar = GP:myVariable > 0]
>   temp.myColumn = CONTENT
>   temp.myColumn.table = tx_myTable
>   temp.myColumn.select.pidInList = 123
>   temp.myColumn.select.andWhere.data = GPVar:myVariable
>   temp.myColumn.select.andWhere.wrap = uid=|
>   temp.myColumn.renderObj = TEXT
>   temp.myColumn.renderObj.field = myColumn
> 
>   subparts.MYMARKER.20 < temp.myColumn
> [global]
> 
> ....which means that the condition works and I can fetch the pid of the
> page that is to be included as subparts.MYMARKER.20. As a proof I can
> display that pid number.
> 
> However, I don't actually know how to assign that fetched pid to
> 'subparts.MYMARKER.20.select.pidInList' so that the content from that
> page would get included:
> 
> subparts.MYMARKER.20 < styles.content.get
> subparts.MYMARKER.20.select.pidInList = ???
> 
> 
> I know I am just a litlle baby step from the final solution. Could you
> please give me one more hint on how to assign that fetched pid?

Try this:

temp.myColumn < styles.content.get
temp.myColumn.select.pidInList.cObject = CONTENT
temp.myColumn.select.pidInList.cObject {
	table = myTable
	select {
		selectFields = myField
		andWhere.data = GPVar:myVariable
		andWhere.wrap = uid=|
	}
	renderObj = TEXT
	renderObj.field = myField
}

pidInList is made a cObject through stdWrap. As cObject it can be 
anything. I chosen to fetch myField from myTable and record with 
uid=myVariable.

Is this what you were looking for? It is different from what I said in 
previous message but better. I did not test it but it should not have 
many errors :) At least I checked it all with TSRef.

-- 
Dmitry Dulepov
http://typo3bloke.net/

"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)



More information about the TYPO3-english mailing list