5

My R5.3 .NET TBB code uses engine.PublishingContext.RenderContext to store ContextVariables.

When using the Template Builder to create/debug my Compound Component Template, all works fine. But when I publish the Dynamic Component, the engine.PublishingContext.RenderContext is null in the TBB.

Anyone has an idea what could be the cause of this?

  • what are you doing with Context Variables? Why not just use plain package variables? – Nickoli Roussakov Oct 31 '13 at 16:57
  • Thanks for your fast answers. However, regardless of the use of the contextvariables, is it not very strange that the Rendercontext itself is null when publishing a dynamic component? As I recall, the Rendercontext should juist be available, and actually is during Template Builde execution, so how can it be null? And BTW, I would like to use the ContextVariables to pass data beween TBBs. – user772 Oct 31 '13 at 18:26
  • Hi Jaco - I've converted your answer to a comment as it doesn't really answer your question. – Rob Stevenson-Leggett Oct 31 '13 at 18:29
  • The package should be used to pass data between TBBs. If you share some code we can take a deeper look. – Nickoli Roussakov Nov 1 '13 at 3:00
4

You mention that your component is Dynamic. This means that it is published independently within its own context. I am going to take a guess that you're using Context Variables to pass data between Page and Component Presentation scopes. This works when the page is published with statically embedded Component Presentations, not Dynamic ones.

The reason it works in Template Builder is because TB presents your session as if everything was statically embedded. It does not distinguish between dynamic and static.

3

On top of Nick's answer... If you want to pass information from Page to Dynamic Component Presentation, I recommend you do it on the Presentation Server, at request time.

Have a look at the following blog posts to see examples of a specific use-case. You can apply the same generic approach to pass any other parameter:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.