[TYPO3-templavoila] Multiple fields in an FCE accessing the same record

Michael Knabe typo3 at mfkhh.de
Tue Apr 19 17:18:49 CEST 2011


I am relatively new to TV and I'm trying to do something quite complex
in my opinion. I hope you can help.

I am trying to add a DB-field to the FCE that links to a
commerce-article and outputs the order number (this works quite well).
Afterwards I want to add another field, that outputs the price of the
same article.

I have one field in my flexible content element that references a
commerce article:
	Element Preset:
		Page-Content Elements [Pos.: 0]
	Form configuration:
	TypoScript Code:
		lib.field_article = CONTENT
		lib.field_article {
			table = tx_commerce_articles
			select {
				pidInList = 147
				andWhere.current = 1
				andWhere.wrap = uid=|
		10 < lib.field_article

So far everything is fine. Now I have another field with the following
	Element Preset:
		None (TypoScript only)
	TypoScript Code:
		lib.field_article_price = CONTENT
		lib.field_article_price {
			table = tx_commerce_article_prices
			select {
				pidInList = 147
				andWhere.current = 1
				andWhere.wrap = uid_article=
			renderObj {
				10 = TEXT
				10.dataWrap = {field:price_gross}
		10 < lib.field_article_price

The latter does of cause not work, as the UID of the article is no
longer available in the select query and I have no clue how to access
the UID in the second field. I also tried to put it into a register but
had no success.
I also tried to put both, the article number and the price into the
first fields setup and access lib.field_article_price in the second
field, but lib seems to be empty then.

Do you know any way to access the record linked in one field in the
other field?


More information about the TYPO3-project-templavoila mailing list