I am running into a situation where I have a fied with the value ${test}, in my component template that renders this the value comes out ok the problem comes in when another template calls this component and templates using @@RenderComponentPresentation(Component.ID, MyFirstTemplate)@@ at this point the ${test} is evaluated and because there is no such item on the component or in the package it evaluates to nothing.
I have Component Template One that reads the value of a Component field (which contains: ${test})
Now I have Component Template Two that calls @@RenderComponentPresentation(Component.ID, ComponentTemplateOne.ID)@@
${test} now gets evaluated instead of retained so it goes from ${test} to "" because it doesn't find a variable or component field name with that name.Component Template Two then gets called by Component Template Three in the same way @@RenderComponentPresentation(Component2.ID, ComponentTemplateTwo.ID)@@
${test} has already been evaluated and lost in Component Template Two I no longer end up with ${test} I am still left with "".I have tried:
@@RenderComponentField('myField', 0, False, False)@@@@RenderComponentField('myField', 0, True, False)@@@@RenderComponentField('myField', 0, False, True)@@no luck.
The following was my work around and it seems to work:
$\{test\} ${test} to $\{test\} in the initial template and a C# TBB on the Page Template that then returns it to the initial value of ${test}.Is there a way to prevent this from happening or a way to avoid doing what i am doing to make this work?
Have you tried this link , you should be able to this with this link
@@"$" + "{" + "test" + "}"@@
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With