First attempt to services section

- base.py: add settings to load GlasfaserServicesPlugin by default
    - glasfaser_cms_page.html: create a placeholder for services
    - cms_plugins.py: add the plugin code
    - models.py: add UngelichTextSectionWithImage model
This commit is contained in:
M.Ravi 2017-10-18 09:10:50 +02:00
commit f6468a7c8c
4 changed files with 36 additions and 43 deletions

View file

@ -2,7 +2,8 @@ from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from .models import (
UngelichPicture, UngelichContactUsSection, UngelichTextSection
UngelichPicture, UngelichContactUsSection, UngelichTextSection,
UngelichTextSectionWithImage
)
@ -40,3 +41,18 @@ class SectionTextParagraphGlasfaser(CMSPluginBase):
model = UngelichTextSection
render_template = "ungleich_page/glasfaser/section_text_glasfaser.html"
cache = False
@plugin_pool.register_plugin
class GlasfaserServicesPlugin(CMSPluginBase):
model = UngelichTextSectionWithImage
render_template = "ungleich_page/glasfaser/section_services.html"
cache = False
def render(self, context, instance, placeholder):
context.update({
'image': instance.image,
'object': instance,
'placeholder': placeholder
})
return context