Global context variables

Miro Community provides the following global context variables:

     
  • tier_info: A SiteTierInfo instance, which contains basic information about your account level
  •  
  • site_settings: A SiteSettings instance with other information about your site settings.
  •  
  • categories: A list of your root categories. (Categories with no parents.)
  •  
  • browse_modules: A list of template names which provide elements in the Browse menu.
  •  
  • messages: A list of messages sent to the current user. (Django docs)
  •  
  • user: A User instance representing the person currently accessing the page.
  •  
  • request: The current request object. (Django docs)
  •  
  • request.user_is_admin: True if the current user has admin privileges on the site, False otherwise.
  •  
  • FACEBOOK_APP_ID: The app ID your site is currently using for logins.
  •  
  • GOOGLE_ANALYTICS_UA: The UA string currently being used to record analytics for your site.
  •  
  • GOOGLE_ANALYTICS_DOMAIN: The domain currently being used to record analytics for your site.

Deprecated global context variables

These context variables are still provided in 1.10, but they will be removed in a future version, so make sure you aren't using them.

     
  • sitelocation: Renamed to site_settings.
  •  
  • settings.LOGIN_URL: Replace with {% url 'auth_login' %}?next={{ request.META.PATH_INFO }}
  •  
  • settings.LOGOUT_URL: Replace with {% url 'auth_logout' %}?next={{ request.META.PATH_INFO }}
  •  
  • settings.RECAPTCHA_PUBLIC_KEY
  •  
  • settings.<anything_else>: These settings are now available directly to the global context.
  •  
  • MEDIA_URL/settings.MEDIA_URL
  •  
  • user_is_admin: Use request.user_is_admin instead.
  •  
  • STATIC_URL: Use the {% static %} tag instead. (Django docs - but load uploadtemplate rather than staticfiles to check for static files in your theme first.)
  •  
  • display_submit_button: Use site_settings.display_submit_button.
  •  
  • VIDEO_STATUS_UNAPPROVED, VIDEO_STATUS_ACTIVE, VIDEO_STATUS_REJECTED: If you have a video instance called video, these can be accessed as {{ video.UNAPPROVED }}, {{ video.ACTIVE }}, and {{ video.REJECTED }}.


Video Listing Page context variable changes


The following changes are already available, but the older variables will be removed in future versions. Be sure to make these changes as soon as possible!

  • {{ video_list }} is now {{ videos }}
  • {{ query }} is now {{ form.q.value }} (or just {{ form.q }} if you want to render an input field)