示例#1
0
 def render(self, context):
     width_var = getattr(self, 'width', None)
     if width_var:
         try:
             width = width_var.resolve(context)
         except template.VariableDoesNotExist:
             # should we raise an error here?
             width = None
     else:
         width = None
         
     if context.get('display_placeholder_names_only'):
         return "<!-- PlaceholderNode: %s -->" % self.name
         
     if not 'request' in context:
         return ''
     request = context['request']
     
     page = request.current_page
     if page == "dummy":
         return ""
     content = render_plugins_for_context(self.name, page, context, width)
     if not content and self.nodelist_or:
         return self.nodelist_or.render(context)
     return content
示例#2
0
 def render(self, context):
     if context.get('display_placeholder_names_only'):
         return "<!-- PlaceholderNode: %s -->" % self.name
         
     if not 'request' in context:
         return ''
     request = context['request']
     
     page = request.current_page
     if page == "dummy":
         return ""
     return render_plugins_for_context(self.name, page, context, self.theme)
示例#3
0
    def render(self, context):
        width_var = getattr(self, "width", None)
        if width_var:
            try:
                width = width_var.resolve(context)
            except template.VariableDoesNotExist:
                # should we raise an error here?
                width = None
        else:
            width = None

        if context.get("display_placeholder_names_only"):
            return "<!-- PlaceholderNode: %s -->" % self.name

        if not "request" in context:
            return ""
        request = context["request"]

        page = request.current_page
        if page == "dummy":
            return ""
        return render_plugins_for_context(self.name, page, context, width)