Discussion:
[TYPO3-english] Passing dynamic data to FLUIDTEMPLATE
Victor Livakovsky
2012-03-29 11:57:25 UTC
Permalink
Hi, lsit.

I'm developing a website with FLUIDTEMPLATE and would like to pass some
data, that comes from TS.
F.e.
I have following setup:
lib.single_content = RECORDS
lib.single_content.tables = tt_content
lib.single_content.source.current = 1

With such a line in my template content element is fetched successfully:
<f:cObject typoscriptObjectPath="lib.single_content" data="272" />

But I want to pass data from TS and use "lib.single_content" in a couple of
other places on a page, but with different source parameter.

Tried to make it this way:
variables {
ccId = TEXT
ccId.value = 272
}
<f:cObject typoscriptObjectPath="lib.single_content" data="{ccId}" />
but this code doesn't work.

How can I properly do that?
Victor Livakovsky
2012-03-30 10:53:33 UTC
Permalink
Post by Victor Livakovsky
variables {
ccId = TEXT
ccId.value = 272
}
<f:cObject typoscriptObjectPath="lib.single_content" data="{ccId}" />
but this code doesn't work.
So, as I understand, it is not possible to pass TS objects to fluid?
Kay Strobach
2012-03-30 13:18:06 UTC
Permalink
Hi,

you may pass TS Objects to fluid with <f:cObject, but the way back is
not known to me.

BUT you may create a custom viewHelper, which contains your cObject ;),
then you can pass whatever param you like :)

Regards
Kay
Post by Victor Livakovsky
Post by Victor Livakovsky
variables {
ccId = TEXT
ccId.value = 272
}
<f:cObject typoscriptObjectPath="lib.single_content" data="{ccId}" />
but this code doesn't work.
So, as I understand, it is not possible to pass TS objects to fluid?
--
http://www.kay-strobach.de - Open Source Rocks

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org

Answer was useful: https://flattr.com/profile/kaystrobach
Victor Livakovsky
2012-03-30 13:45:44 UTC
Permalink
Hi, Kay.
Post by Kay Strobach
you may pass TS Objects to fluid with <f:cObject, but the way back is
not known to me.
BUT you may create a custom viewHelper, which contains your cObject ;),
then you can pass whatever param you like :)
Thank you for the answer!
I recently found the reason of an issue - it is in my previous comment.
I know about custom viewHelpers, but I want to achieve such a thing: develop
a website without any line of php code for trivial tasks.
That's why I'm using the power of Fluid: FLUIDTEMPLATE and flux with fed
extensions - solutions look really cool and modern :)
Victor Livakovsky
2012-03-30 13:39:44 UTC
Permalink
Post by Victor Livakovsky
Post by Victor Livakovsky
variables {
ccId = TEXT
ccId.value = 272
}
<f:cObject typoscriptObjectPath="lib.single_content" data="{ccId}" />
but this code doesn't work.
So, as I understand, it is not possible to pass TS objects to fluid?
Well, after two days of fighting I found, what was the reason: variables are
NOT visible in partials. If I put variable into layout or into template, it
is outputted, but not in partial!
Don't know, is it a bug or a feature?
TYPO3 4.6.4

I wonder, if it is mentioned in some documentation about Fluid?..
Sören Kracker
2012-03-30 14:14:38 UTC
Permalink
You have to pass the variables as arguments to the partial:
<f:render partial="Xyc/Properties" arguments="{myvar:myvalue}" />

See: http://wiki.typo3.org/Fluid#f:render
Post by Victor Livakovsky
Post by Victor Livakovsky
variables {
ccId = TEXT
ccId.value = 272
}
<f:cObject typoscriptObjectPath="lib.single_content" data="{ccId}" />
but this code doesn't work.
So, as I understand, it is not possible to pass TS objects to fluid?
variables are NOT visible in partials. If I put variable into layout
or into template, it is outputted, but not in partial!
Don't know, is it a bug or a feature?
TYPO3 4.6.4
I wonder, if it is mentioned in some documentation about Fluid?..
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
Victor Livakovsky
2012-03-30 14:27:26 UTC
Permalink
Hi, S?ren
Post by Sören Kracker
<f:render partial="Xyc/Properties" arguments="{myvar:myvalue}" />
See: http://wiki.typo3.org/Fluid#f:render
Ah! That was the missing brick in my Fluid knowledge's wall. Thank you so
much!
Kay Strobach
2012-03-30 17:03:31 UTC
Permalink
there is also a way to pass variables to partials -> features
Post by Victor Livakovsky
Post by Victor Livakovsky
Post by Victor Livakovsky
variables {
ccId = TEXT
ccId.value = 272
}
<f:cObject typoscriptObjectPath="lib.single_content" data="{ccId}" />
but this code doesn't work.
So, as I understand, it is not possible to pass TS objects to fluid?
Well, after two days of fighting I found, what was the reason: variables
are NOT visible in partials. If I put variable into layout or into
template, it is outputted, but not in partial!
Don't know, is it a bug or a feature?
TYPO3 4.6.4
I wonder, if it is mentioned in some documentation about Fluid?..
--
http://www.kay-strobach.de - Open Source Rocks

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org

Answer was useful: https://flattr.com/profile/kaystrobach
Loading...