Content types


Third-party application inclusion support.

feincms.content.application.models.app_reverse(viewname, urlconf, args=None, kwargs=None, prefix=None, *vargs, **vkwargs)

Reverse URLs from application contents

Works almost like Django’s own reverse() method except that it resolves URLs from application contents. The second argument, urlconf, has to correspond to the URLconf parameter passed in the APPLICATIONS list to Page.create_content_type:

app_reverse('mymodel-detail', 'myapp.urls', args=...)


app_reverse('mymodel-detail', 'myapp.urls', kwargs=...)

The second argument may also be a request object if you want to reverse an URL belonging to the current application content.

feincms.content.application.models.app_reverse_lazy(*args, **kw)

Lazy version of app_reverse


Decorator that calls app_reverse()

Use this instead of standard django.db.models.permalink if you want to integrate the model through ApplicationContent. The wrapped function must return 4 instead of 3 arguments:

class MyModel(models.Model):
    def get_absolute_url(self):
        return ('myapp.urls', 'model_detail', (), {'slug': self.slug})
feincms.content.application.models.retrieve_page_information(page, request=None)

This is the request processor responsible for retrieving information about the currently processed page so that we can make an optimal match when reversing app URLs when the same ApplicationContent has been added several times to the website.


Embed a comment list and comment form anywhere. Uses the standard django.contrib.comments application.


Simple contact form for FeinCMS. The default form class has name, email, subject and content fields, content being the only one which is not required. You can provide your own comment form by passing an additional form=YourClass argument to the create_content_type call.


Simple file inclusion content: You should probably use the media library instead.


Simple image inclusion content: You should probably use the media library instead.

class feincms.content.image.models.ImageContent(*args, **kwargs)

Create an ImageContent like this:

        ('left', 'Float to left'),
        ('right', 'Float to right'),
        ('block', 'Block'),
        ('noop', 'Do not resize'),
        ('cropscale:100x100', 'Square Thumbnail'),
        ('cropscale:200x450', 'Medium Portait'),
        ('thumbnail:1000x1000', 'Large'),

Note that FORMAT_CHOICES is optional. The part before the colon
corresponds to the template filters in the ``feincms_thumbnail``
template filter library. Known values are ``cropscale`` and
``thumbnail``. Everything else (such as ``noop``) is ignored.


class feincms.content.medialibrary.models.MediaFileContent(*args, **kwargs)

Rehashed, backwards-incompatible media file content which does not contain the problems from v1 anymore.

Create a media file content as follows:

from feincms.content.medialibrary.v2 import MediaFileContent
Page.create_content_type(MediaFileContent, TYPE_CHOICES=(
    ('default', _('Default')),
    ('lightbox', _('Lightbox')),
    ('whatever', _('Whatever')),

For a media file of type ‘image’ and type ‘lightbox’, the following templates are tried in order:

  • content/mediafile/image_lightbox.html
  • content/mediafile/image.html
  • content/mediafile/lightbox.html
  • content/mediafile/default.html

The context contains content and request (if available).


class feincms.content.raw.models.RawContent(*args, **kwargs)

Content type which can be used to input raw HTML code into the CMS.

The content isn’t escaped and can be used to insert CSS or JS snippets too.


class feincms.content.richtext.models.RichTextContent(*args, **kwargs)

Rich text content. Uses TinyMCE by default, but can be configured to do anything you want using FEINCMS_RICHTEXT_INIT_CONTEXT and FEINCMS_RICHTEXT_INIT_TEMPLATE.

Optionally runs the HTML code through HTML cleaners if you specify cleanse=True when calling create_content_type.


class feincms.content.rss.models.RSSContent(*args, **kwargs)

RSS feed inclusion content.

This content requires a cronjob on the server, which runs ./ update_rsscontent every couple of hours.


class feincms.content.section.models.SectionContent(*args, **kwargs)

Title, media file and rich text fields in one content block.


class feincms.content.table.models.TableContent(*args, **kwargs)

Content to edit and display HTML tables in the CMS.

The standard rich text editor configuration in FeinCMS does not activate the table plugin. This content type can be used to edit and display nicely formatted HTML tables. It is easy to specify your own table renderers.

class feincms.content.table.models.TableFormatter(**kwargs)

Table formatter which should convert a structure of nested lists into a suitable HTML table representation.

class feincms.content.table.models.TitleTableFormatter(**kwargs)

TitleTableFormatter(first_row_title=True, first_column_title=True)


class feincms.content.template.models.TemplateContent(*args, **kwargs)

This content type scans all template folders for files in the content/template/ folder and lets the website administrator select any template from a set of provided choices.

The templates aren’t restricted in any way.


class*args, **kwargs)

Copy-paste a URL to youtube or vimeo into the text box, this content type will automatically generate the necessary embed code.

Other portals aren’t supported currently, but would be easy to add if anyone would take up the baton.

You should probably use feincms-oembed.