2

I've got this scenario:

  • A Tridion 2011 using the Razor mediator
  • An ASP.Net 4 DLL implementing some custom Web Controls
  • A Dynamic Component Template that must render a summary of an item and a link button to the detail page

In this scenario, the custom Web Control is in charge of performing some broker queries, retrieve the indicated components and then render them using the already mentioned Dynamic Component Template.

I'm using the class ComponentPresentationAssembler for this purpose and invoking the method GetContent and providing the ID of the Component and the ID of the Template I get some output.

Now my question is; there is an overload of the method ComponentPresentationAssembler.GetContent that allows you to provide a dictionary with variables so, how could I get again those variables from the Dynamic Component Template? They seem to be no context variables.

2

From the old forum, someone asked about the java.util.Map<java.lang.String,java.lang.String> renderingParameters parameter in ComponentPresentationAssembler's getContent().

Nuno Linhares suggested this might be optionally used by XSLT Component Templates (CT). CTs set to XML Document can store run-time XSLT which might use parameters like Publication ID and others.*

I'll add that this needs to be via ComponentPresentationAssembler rather than ComponentPresentationFactory. These XSLT CTs are distinct from modular templates using the XSLT Mediator (see the docs). John Winter also asks about the XML Document setting and extra tab in this question.

In practice I haven't seen this parameter used (especially if Nuno said he wasn't sure). Though something like it could make a nice "enchancement request" for the Razor Mediator.

1

This dictionary parameter is there since 2011 but does not seem to be implemented yet, may be kept for future.

if you have any specific requirement which is not fulfilled by the Getcontent, let the group know.

  • Thanks Raj. I would find really handy that you could use that overload to provide parameters to any type of CT (this is XSLT, Razor, C#), attached for example as package variables. In my scenario it would make really straightforward to submit the source page TCM URI to a dynamic template. – glezalex Jul 6 '15 at 7:30

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.