Show
Ignore:
Timestamp:
02/22/08 15:02:26 (9 months ago)
Author:
JensDiemer
Message:

A new way to setup contextrobots?
I am not really convinced of it yet.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/PyLucid/index.py

    r1429 r1440  
    4545 
    4646 
    47 def _render_cms_page(context, page_content=None): 
     47def _render_cms_page(request, context, page_content=None): 
    4848    """ 
    4949    render the cms page. 
     
    5151    - render a _command request: The page.content is the output from the plugin. 
    5252    """ 
     53    if request.anonymous_view == False: 
     54        # context["robots"] was set in contex_processors.static() 
     55        # Hide the response from search engines 
     56        context["robots"] = "NONE,NOARCHIVE" 
     57 
    5358    current_page = context["PAGE"] 
    5459 
     
    9297    For index() and handle_command() views. 
    9398    """ 
     99    # add additional attribute 
     100    request.anonymous_view = True 
     101 
    94102    try: 
    95103        context = RequestContext(request) 
     
    227235    context = _get_context(request, current_page_obj) 
    228236    # Get the response for the requested cms page: 
    229     response = _render_cms_page(context) 
     237    response = _render_cms_page(request, context) 
    230238 
    231239    if use_cache: 
     
    317325        ) 
    318326 
    319     return _render_cms_page(context, page_content) 
     327    return _render_cms_page(request, context, page_content) 
    320328 
    321329