From 502d822a02850b291bef1fe91c8e9f07f14f528a Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 14:05:17 +0200 Subject: [PATCH] Add section id from cms in the contact us section --- ungleich_page/cms_plugins.py | 8 ++++++++ .../ungleich_page/glasfaser/section_contact.html | 4 ++-- .../templates/ungleich_page/glasfaser_cms_page.html | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 388e6049..d6035499 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -44,6 +44,14 @@ class SectionContact(CMSPluginBase): render_template = "ungleich_page/glasfaser/section_contact.html" cache = False + def render(self, context, instance, placeholder): + context = super(SectionContact, self).render( + context, instance, placeholder + ) + context['instance'] = instance + context['section_id'] = get_section_id(instance, 'contact') + return context + @plugin_pool.register_plugin class SectionTextParagraphDCL(CMSPluginBase): diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html index afc089b1..cd1c856b 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html @@ -1,7 +1,7 @@ {% load i18n %} -
-
+
+
diff --git a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html index f0b8c050..8f76b29f 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html +++ b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html @@ -86,7 +86,7 @@