Content types

ApplicationContent

Third-party application inclusion support.

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

This reverse replacement adds two new capabilities to the Django reverse method:

  • If reverse is called from inside ApplicationContent.process, it automatically prepends the URL of the page the ApplicationContent is attached to, thereby allowing reverse and {% url %} to return correct URLs without hard-coding the application integration point into the templates or URLconf files.

  • If the viewname contains a slash, the part before the slash is interpreted as the path to an URLconf file. This allows the template author to resolve URLs only reachable via an ApplicationContent, even inside another application contents’ process method:

    {% url registration.urls/auth_logout %}

CommentsContent

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

ContactFormContent

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.

FileContent

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

ImageContent

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:

Cls.create_content_type(ImageContent, POSITION_CHOICES=(
    ('left', 'Left'),
    ('right', 'Right'),
    ))

MediaFileContent

Media library-based file inclusion tool. Can handle any type of media file, not only images.

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

Create a media file content as follows:

Page.create_content_type(MediaFileContent, POSITION_CHOICES=(
    ('default', _('Default')),
    ('lightbox', _('Lightbox')),
    ('whatever', _('Whatever')),
    ))

For a media file of type ‘image’ and position ‘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.medialibrary.models.MediaFileWidget(attrs=None)

TextInput widget, shows a link to the current value if there is one.

RawContent

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.

RichTextContent

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.

RSSContent

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

RSS feed inclusion content.

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

SectionContent

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

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

TableContent

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)

TemplateContent

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.

VideoContent

class feincms.content.video.models.VideoContent(*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.