Beispiel #1
0
def render_to_response(component,  
                       context = {}, context_instance = {}):
    """ Similar to django render_to_response, this take a context, an 
optional request context, a cms context and a component name. It then 
renders and returns an HttpResponse. The component is a component_cid."""
    context_instance.update(context)
    rendered_component = renderComponent(component_cid = component)
    return HttpResponse( Template(rendered_component).render(context_instance) )
Beispiel #2
0
 def render(self, context):
     if self.templateVar:
         name = context[self.templateVar]
     else:
         name = self.templateName
     component = renderComponent(name)
     context['zcms_internal_component_'] = Template(component)
     return ExtendsNode.render(self, context)