Add UngleichHeaderWithTextAndImageSliderPlugin and UngleichHeaderItemPlugin
This commit is contained in:
		
					parent
					
						
							
								7aca251260
							
						
					
				
			
			
				commit
				
					
						d006ddcf0d
					
				
			
		
					 1 changed files with 33 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -3,7 +3,8 @@ from cms.plugin_pool import plugin_pool
 | 
			
		|||
 | 
			
		||||
from .models import (
 | 
			
		||||
    UngelichContactUsSection, UngelichTextSection, Service, ServiceItem,
 | 
			
		||||
    About, AboutItem, SectionWithImage, UngleichServiceItem
 | 
			
		||||
    About, AboutItem, SectionWithImage, UngleichServiceItem, UngleichHeader,
 | 
			
		||||
    UngleichHeaderItem
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -176,4 +177,35 @@ class UngleichServicesItemPlugin(CMSPluginBase):
 | 
			
		|||
            context, instance, placeholder
 | 
			
		||||
        )
 | 
			
		||||
        context['instance'] = instance
 | 
			
		||||
        return context
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@plugin_pool.register_plugin
 | 
			
		||||
class UngleichHeaderWithTextAndImageSliderPlugin(CMSPluginBase):
 | 
			
		||||
    name = "ungleich Header with Text and Image Slider Plugin"
 | 
			
		||||
    model = UngleichHeader
 | 
			
		||||
    render_template = "ungleich_page/ungleich/header.html"
 | 
			
		||||
    cache = False
 | 
			
		||||
    allow_children = True
 | 
			
		||||
    child_classes = ['UngleichHeaderItemPlugin']
 | 
			
		||||
 | 
			
		||||
    def render(self, context, instance, placeholder):
 | 
			
		||||
        context['instance'] = instance
 | 
			
		||||
        return context
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@plugin_pool.register_plugin
 | 
			
		||||
class UngleichHeaderItemPlugin(CMSPluginBase):
 | 
			
		||||
    name = "ungleich Header Item Plugin"
 | 
			
		||||
    model = UngleichHeaderItem
 | 
			
		||||
    render_template = "ungleich_page/ungleich/_header_item.html"
 | 
			
		||||
    cache = False
 | 
			
		||||
    require_parent = True
 | 
			
		||||
    parent_classes = ['UngleichHeaderWithTextAndImageSliderPlugin']
 | 
			
		||||
 | 
			
		||||
    def render(self, context, instance, placeholder):
 | 
			
		||||
        context = super(UngleichHeaderItemPlugin, self).render(
 | 
			
		||||
            context, instance, placeholder
 | 
			
		||||
        )
 | 
			
		||||
        context['instance'] = instance
 | 
			
		||||
        return context
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue