def render_tag(self, context, page_lookup): if not 'request' in context: return '' request = context['request'] from cms.plugins.utils import get_plugins_media plugins_media = None if page_lookup: page = _get_page_by_untyped_arg(page_lookup, request, get_site_id(None)) plugins_media = get_plugins_media(request, context, page) else: page = request.current_page if page == "dummy": return '' # make sure the plugin cache is filled plugins_media = get_plugins_media(request, context, request._current_page_cache) if plugins_media: return plugins_media.render() else: return u''
def render(self, context): if not 'request' in context: return '' request = context['request'] page = request.current_page if page == "dummy": return '' from cms.plugins.utils import get_plugins_media plugins_media = get_plugins_media(request, request._current_page_cache) # make sure the plugin cache is filled if plugins_media: return plugins_media.render() else: return u''
def render(self, context): from cms.plugins.utils import get_plugins_media if not "request" in context: return "" request = context["request"] from cms.plugins.utils import get_plugins_media plugins_media = None page_lookup_var = getattr(self, "page_lookup_var", None) if page_lookup_var: page_lookup = page_lookup_var.resolve(context) page = _get_page_by_untyped_arg(page_lookup, request, get_site_id(None)) plugins_media = get_plugins_media(request, context, page) else: page = request.current_page if page == "dummy": return "" # make sure the plugin cache is filled plugins_media = get_plugins_media(request, context, request._current_page_cache) if plugins_media: return plugins_media.render() else: return u""
def render_tag(self, context, page_lookup): log.debug('NewsyPluginsMedia.render_tag') if not 'request' in context: return '' request = context['request'] from cms.plugins.utils import get_plugins_media page = context.get('current_page', 'dummy') if page == "dummy": return '' # make sure the plugin cache is filled plugins_media = get_plugins_media(request, context, page) if plugins_media: return plugins_media.render() else: return u''