The templates provided for Zinnia are simple but complete and as generic as possible. But you can easily change them by specifying a template directory. If you are not familiar with Django, the part two of the excellent Django tutorial explains in detail how to proceed for customizing the look and feel of the admin app, in Zinnia it’s the same thing.
A good starting point is to copy-paste the zinnia/base.html template, and edit the extends instruction for fitting to your skin.
Note
You can also create your own app containing some Zinnia’s templates based on inheritance. You can also create your own app containing some Zinnia’s templates based on inheritance. For example you can find these two applications which aim is to transform the templates for Zinnia to be HTML5 ready, which can be a good starting point to make your own at :
Warning
Changed in version 0.9.
Django Blog Quintet is no longer compatible with Zinnia, but still be a good example.
Yes the comment system integrated in Zinnia is based on django.contrib.comments and can be extended or replaced if doesn’t quite fit your needs. You should take a look on the customizing the comments framework documentation for more information.
Warning
The custom comment Model must be inherited from Comment and implement the CommentManager to properly work with Zinnia.
If you want the ability to reply on comments, you can take a look at django-threadcomments for example.
Yes of course, Zinnia currently support MarkDown, Textile and reStructuredText as markup languages, but if you want to write your entries in a custom markup language a solution is to disable the WYSIWYG editor in the admin site with the ZINNIA_WYSIWYG setting, and use the appropriate template filter in your templates.
Zinnia is designed to be multi-site. That’s mean you can publish entries on several sites or share an admin interface for all the sites handled.
Zinnia also provides a new permission that’s allow or not the user to change the authors. Useful for collaborative works.
But if you want to restrict the edition of the entries by site, authors or whatever you want, it’s your job to implement this functionality in your project.
The simple way to do that, respecting the Django rules, is to override the admin classes provided by Zinnia, and register those classes in another admin site.
Take a looks at sorl.thumbnail and use his templatetags.
You can do something like this in your templates :
<img src="{% thumbnail object.image 250x250 %}" />
Simply create a new application with a model named EntryImage with a ForeignKey to the Entry model.
Then in the admin module of your app, unregister the EntryAdmin class, and use InlineModelAdmin in your new admin class.
Here an simple example :
# The model
from django.db import models
from django.utils.translation import ugettext_lazy as _
from zinnia.models import Entry
class EntryImage(models.Model):
"""Image Model"""
entry = models.ForeignKey(Entry, verbose_name=_('entry'))
image = models.ImageField(_('image'), upload_to='uploads/gallery')
title = models.CharField(_('title'), max_length=250)
description = models.TextField(_('description'), blank=True)
def __unicode__(self):
return self.title
# The admin
from django.contrib import admin
from zinnia.models import Entry
from zinnia.admin import EntryAdmin
from gallery.models import EntryImage
class EntryImageInline(admin.TabularInline):
model = EntryImage
class EntryAdminImage(EntryAdmin):
inlines = (EntryImageInline,)
admin.site.unregister(Entry)
admin.site.register(Entry, EntryAdminImage)
Another and better solution is to extend the Entry model like described in Extending Entry model.