Index: cms/converters.py |
diff --git a/cms/converters.py b/cms/converters.py |
index a59bf2ea26728ead3f5bd243e3c80b77b3aeefa5..b7b856e65b97833afe106969b023ec40ddd32789 100644 |
--- a/cms/converters.py |
+++ b/cms/converters.py |
@@ -292,6 +292,7 @@ class TemplateConverter(Converter): |
globals = { |
"get_string": self.get_string, |
+ "get_page_content": self.get_page_content, |
} |
for dirname, dictionary in [("filters", filters), ("globals", globals)]: |
@@ -342,6 +343,14 @@ class TemplateConverter(Converter): |
default = localedata[name] |
return jinja2.Markup(self.localize_string(name, default, localedata, html_escapes)) |
+ def get_page_content(self, page, locale=None): |
+ from cms.utils import get_page_params |
+ |
+ if locale is None: |
+ locale = self._params["locale"] |
+ params = get_page_params(self._params["source"], locale, page) |
+ return {k: params[k] for k in ("head", "body", "title")} |
Wladimir Palant
2015/04/07 21:17:11
The CMS doesn't know about the title variable - it
kzar
2015/04/08 08:15:24
Done.
|
+ |
def linkify(self, page, locale=None, **attrs): |
if locale is None: |
locale = self._params["locale"] |