Set image and title dynamically
This commit is contained in:
parent
a5dea2b399
commit
8e76a1c671
3 changed files with 26 additions and 9 deletions
|
|
@ -1,14 +1,24 @@
|
|||
from cms.models.pluginmodel import CMSPlugin
|
||||
from cms.plugin_base import CMSPluginBase
|
||||
from cms.plugin_pool import plugin_pool
|
||||
from cms.models.pluginmodel import CMSPlugin
|
||||
|
||||
from .models import UngelichPicture
|
||||
|
||||
|
||||
@plugin_pool.register_plugin
|
||||
class SectionWithImagePlugin(CMSPluginBase):
|
||||
model = CMSPlugin
|
||||
model = UngelichPicture
|
||||
render_template = "ungleich_page/glasfaser/section_with_image.html"
|
||||
cache = False
|
||||
|
||||
def render(self, context, instance, placeholder):
|
||||
context.update({
|
||||
'image': instance.image,
|
||||
'object': instance,
|
||||
'placeholder': placeholder
|
||||
})
|
||||
return context
|
||||
|
||||
|
||||
@plugin_pool.register_plugin
|
||||
class SectionContact(CMSPluginBase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue