Add section id from cms in the contact us section

This commit is contained in:
M.Ravi 2017-10-19 14:05:17 +02:00
parent 428d329d99
commit 502d822a02
3 changed files with 11 additions and 3 deletions

View file

@ -44,6 +44,14 @@ class SectionContact(CMSPluginBase):
render_template = "ungleich_page/glasfaser/section_contact.html" render_template = "ungleich_page/glasfaser/section_contact.html"
cache = False 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 @plugin_pool.register_plugin
class SectionTextParagraphDCL(CMSPluginBase): class SectionTextParagraphDCL(CMSPluginBase):

View file

@ -1,7 +1,7 @@
{% load i18n %} {% load i18n %}
<!-- / contact section --> <!-- / contact section -->
<div id="" class="full-contact-section"> <div id="contact_section" class="full-contact-section">
<div class="intro-header-2 contact-section" id="contact"> <div class="intro-header-2 contact-section" id="{{section_id}}">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">

View file

@ -86,7 +86,7 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
if ($(".has-error").length != 0) { if ($(".has-error").length != 0) {
window.location = window.location.pathname + "#contact" window.location = window.location.pathname + "#contact_section"
} }
}); });
</script> </script>