Open source cms for mobile and desktop websites

nive_cms.app

Nive cms default configuration

This file links together all modules included in a default nive installation.

Minimal local system configuration (sqlite example) and usage

from nive.definitions import AppConf, DatabaseConf

app = AppConf("nive_cms.app",
              id = "website",
              title = "My website")
dbConfiguration = DatabaseConf(
                   fileRoot="/var/opt/website",
                   context=u"Sqlite3",
                   dbName="/var/opt/website/website.db")
app.modules.append(dbConfiguration)
design = ViewModuleConf("nive_cms_design_bs3.view")
app.modules.append(design)
  • Groups: group:editor, group:author, group:admin
  • Additional meta fields: Permission (pool_groups) Object only displayed to users in the selected group

A design is not included by default. The default can simply be included with the following line

app.modules.append("nive_cms_design_bs3.view")

To include a customized copy of the design use

design = ViewModuleConf("nive_cms_design_bs3.view")
# design customizations here
design.static = "mywebsite:static" 
# add to website
app.modules.append(design)

This will replace the static directory of the design with your own directory. However, now you will have to add the required css, images and javascript used by the templates to the new folder. (For a start just copy the contents of nive_cms_design_bs3:static.)

class nive_cms.app.WebsitePublisher(configuration=None)

the main cms application class

nive_cms (objects)

Root

The root is the home page of the website. All contained pages and elements are stored in the database. The root itself does not store anything in the database.

Also this object provides search functions and sql query wrappers.

Page

Pages are rendered as html files and make up the website.

Optionally pages can

  • be hidden in navigation
  • have a header displayed in the content area
  • have a automatically generated readable url name
  • have a manually entered readable url name

Box

A box is a container to group elements on a page. It can be used as an advanced styling element for web pages. The box itself only stores a title and a css class.

Code

Text element to add code snippets to web pages. Supports Javascript, raw HTML and CSS.

class nive_cms.codeblock.code(id, dbEntry, parent, configuration, **kw)

Column

A column is a container to group elements on a page. Columns are not added like normal page elements but have to be defined manually in the main template. A column can be inherited through a hierarchy of pages.

File

The file element provides a simple file download with title and optional description.

Image

The image element inserts images into the web page.

Images uploaded as fullsize will be be linked as pop ups.

If the Python Image Library (PIL) is installed automated image conversion on upload can be activated by adding nive_cms.extensions.images.ImageProcessor to configuration.extensions.

ProfileImage = Conf(source="imagefull", dest="image", format="JPEG", 
                    quality="85", width=360, height=0, extension="jpg", 
                    condition=CheckDeafult)

configuration.imageProfiles = [ProfileImage]

The default image settings for conversions.

class nive_cms.image.image(id, dbEntry, parent, configuration, **kw)

Media

Element to insert audio or video files into the web page. Uses HTML 5 media and audio tags and the browser’s default player.

News item

Simple news item with title, text, image, publish date and link.

Note

Simple text note for authors. The note is only visible to cms authors and not published.

Spacer

Styling element to add line breaks and vertical space between elements.

Text

Text element for the web page. Can be used to add headers, preformatted text and paragraphs to the web page.

class nive_cms.text.text(id, dbEntry, parent, configuration, **kw)

basic text class

class nive_cms.baseobjects.DesignBase(context, request)

Website design base class

  • lookup view module automatically
  • load editor instance
editorview

Tries to load the editor view class. If none is registered the function will simply return None. Otherwise the editor view class instance with context and request set.

© 2013 Nive GmbH