Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/cms/utils.py

Issue 4817131468226560: Added site_url template variable in order to help generating pages that require a full absolute URL (Closed)
Patch Set: Created Feb. 4, 2014, 11:32 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/cms/bin/test_server.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/cms/utils.py
===================================================================
--- a/sitescripts/cms/utils.py
+++ b/sitescripts/cms/utils.py
@@ -17,7 +17,7 @@
from .converters import converters, TemplateConverter
-def process_page(source, locale, page, format):
+def process_page(source, locale, page, format, site_url_override=None):
params = {
"source": source,
"template": "default",
@@ -33,6 +33,12 @@
localefile = params["config"].get("locale_overrides", page)
params["localedata"] = source.read_locale(params["locale"], localefile)
+ if params["config"].has_option("general", "siteurl"):
+ if site_url_override:
+ params["site_url"] = site_url_override
+ else:
+ params["site_url"] = params["config"].get("general", "siteurl")
+
try:
converter = converters[format](params)
except KeyError:
« no previous file with comments | « sitescripts/cms/bin/test_server.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld