Open source cms for mobile and desktop websites

CMS - Getting started

Starting the webserver

Once Pyramid and Nive are installed, you can start the webserver from the instance directory nive/myWebsite by calling

#Unix
../bin/pserve development.ini

#Windows
..\Scripts\pserve development.ini

If you get a message similar to the following the server has started all right.

Starting HTTP server on http://0.0.0.0:6543

Now open your web browser and enter http://127.0.0.1:6543 to load the website in your browser.

../_images/website.png

Editing the web page

Note

You can always append /editor to the current url to edit a page.

To switch into edit mode append /editor to the current url in the location bar. Now the Nive toolbox shows up on the right and the elements on the page are interactive.

The toolbox can be dragged to any place in the browser window.

Click on one of the page elements to load the small edit bar or form of the specific element in an overlay.

To cancel an overlay form click outside of the overlay to close it. The close button on top/right does the same, but also reloads the main page.

To leave the editor click Exit editor in the settings section of the toolbox.

The website’s layout and styles

The website uses a copy of the website’s css and images for customization. You can find them in the default directory

myWebsite/static

All files from this directory and subdirectories are served as static files by the webserver. Add further files here and link them in css or html.

The files responsible for the style and layout is styles.css. Just change anything in this files, reload the web page and you’ll see the changes immediately.

The default template set is based on bootstrap 3. If you are familiar with the bootstrap css framework it should be easy to change the layout to your needs.

The main template

The main template is included as a copy. Open the following file in a html or text editor:

myWebsite/templates/index.pt

This is a Chameleon page template. If you are unfamiliar with page template syntax please have a look at CMS - Styling the website.

Note

Page templates will check for valid html syntax and blocks. In case of errors the template won’t render!

In short: All page template syntax is included as html tag attributes tal: and metal: or ${...} anywhere in the template. The expressions used by default are python. Change anything and reload the webpage to see what you’ve done.

The configuration

The configuration of the website including database and data directory is included in

myWebsite/__init__.py

The block responsible for the cms configuration contains the following code:

website = AppConf("nive_cms.app",
      title="Nive",
      id="website"
)
dbConfiguration = DatabaseConf(
         fileRoot="data/website",
         # SQLite
         context="Sqlite3",
         dbName="data/website.db"
)
website.modules.append(dbConfiguration)

with the following elements:

  • title of the website
  • id (the url path name of the cms)
  • fileRoot (file system root directory for the files)
  • dbName (sqlite database file)

All options are listed in api/definitions.

© 2013 Nive GmbH