Open source cms for mobile and desktop websites

Design plugin example: Json configuration

json configuration example for a website design including main template and static directory

Scaffold download:

The module has to be in the current python path to be added to your website.

website.modules.append("nive_tmpl_design_json")

configuration.json

The file configuration.json defines everything needed to set up the design.

{
  "type": "nive.definitions.ViewModuleConf",
  "copyFrom": "nive_cms.design.view",

  "static": "nive_tmpl_design_json:static",
  "staticName": "tmpldesign",
  "templates": "nive_tmpl_design_json:templates"
}

Templates

Files included in the template directory replace the default templates by name. The example inclueds the main website layout template index.pt.

Static files

The configuration includes static as static directory and maps it to tmpldesign url.

__init__.py

Finally the modules nive_tmpl_design_json/__init__.py sets the plugin up as python module.

from nive.helper import LoadConfiguration
configuration = LoadConfiguration("configuration.json")
© 2013 Nive GmbH