Add ungleich HTML only template
This commit is contained in:
parent
7fa23577f6
commit
6ec7fc182b
4 changed files with 54 additions and 1 deletions
|
@ -5,7 +5,7 @@ from .models import (
|
||||||
UngelichContactUsSection, UngelichTextSection, Service, ServiceItem,
|
UngelichContactUsSection, UngelichTextSection, Service, ServiceItem,
|
||||||
About, AboutItem, SectionWithImage, UngleichServiceItem, UngleichHeader,
|
About, AboutItem, SectionWithImage, UngleichServiceItem, UngleichHeader,
|
||||||
UngleichHeaderItem, UngleichProductItem, UngleichProduct, UngleichCustomer,
|
UngleichHeaderItem, UngleichProductItem, UngleichProduct, UngleichCustomer,
|
||||||
UngleichCustomerItem
|
UngleichCustomerItem, UngleichHTMLOnly
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -274,3 +274,18 @@ class UngleichCustomerItemPlugin(CMSPluginBase):
|
||||||
)
|
)
|
||||||
context['instance'] = instance
|
context['instance'] = instance
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
@plugin_pool.register_plugin
|
||||||
|
class UngleichHTMLPlugin(CMSPluginBase):
|
||||||
|
name = "ungleich HTML Plugin"
|
||||||
|
model = UngleichHTMLOnly
|
||||||
|
render_template = "ungleich_page/ungleich/html_block.html"
|
||||||
|
cache = False
|
||||||
|
|
||||||
|
def render(self, context, instance, placeholder):
|
||||||
|
context = super(UngleichHTMLPlugin, self).render(
|
||||||
|
context, instance, placeholder
|
||||||
|
)
|
||||||
|
context['instance'] = instance
|
||||||
|
return context
|
||||||
|
|
29
ungleich_page/migrations/0013_ungleichhtmlonly.py
Normal file
29
ungleich_page/migrations/0013_ungleichhtmlonly.py
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.9.4 on 2017-11-23 11:49
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
import djangocms_text_ckeditor.fields
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cms', '0014_auto_20160404_1908'),
|
||||||
|
('ungleich_page', '0012_ungleichcustomer_ungleichcustomeritem'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='UngleichHTMLOnly',
|
||||||
|
fields=[
|
||||||
|
('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')),
|
||||||
|
('HTML', djangocms_text_ckeditor.fields.HTMLField()),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
bases=('cms.cmsplugin',),
|
||||||
|
),
|
||||||
|
]
|
|
@ -144,3 +144,7 @@ class UngleichCustomerItem(CMSPlugin):
|
||||||
)
|
)
|
||||||
url = models.URLField(max_length=300, default="", blank=True)
|
url = models.URLField(max_length=300, default="", blank=True)
|
||||||
description = HTMLField()
|
description = HTMLField()
|
||||||
|
|
||||||
|
|
||||||
|
class UngleichHTMLOnly(CMSPlugin):
|
||||||
|
HTML = HTMLField()
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{% load cms_tags static %}
|
||||||
|
{{instance.HTML}}
|
||||||
|
{% for plugin in instance.child_plugin_instances %}
|
||||||
|
{% render_plugin plugin %}
|
||||||
|
{% endfor %}
|
Loading…
Reference in a new issue