0.1.8 • Published 11 years ago

cliste v0.1.8

Weekly downloads
59
License
-
Repository
github
Last release
11 years ago

Cliste CMS

What is it?

This is currently a work in progress, any developers that want to help let me know!

Cliste CMS utilizes Node.js and Handlebars.js to create a 100% JavaScript based CMS. This is currently a work in progress and does not yet support all functionalities you would expect in a CMS. User Management, Permissions, Database API and Forms are still outstanding components. Implemented components include the Server, Virtual Paths, Theming, File Management and Aliases. This CMS has been inspired by Drupal and follows many of the file/folder structures. That said, this is not a Drupal clone by any means, although there are many similiarities.

Setup

Download/clone this project to your system. Use npm to install:

npm install require-dir handlebars mongodb mongoose node-static -g

Update settings.js to include the correct path to Cliste

Then go into the project, and run "node index.js"

If you get a module not found error, don't forget to link it, like so:

npm link require-dir

Where require-dir is the name of the module

Also, don't forget to make sure mongodb is running

Module Creation

  1. To create a new module, create a new folder at /sites/all/module/{{module-name}}
  2. Create a file called index.js inside the folder you just created
  3. If needed, create a folder called template, and add any handlebars templates you might need

An example of the home module:

	/**
	 *	@description
	 *		This module will control the home page
	 *	@author
	 *		Brian Martin
	 *	@version
	 *		1.0.0
	 *	@namespace
	 *		Home
	 */
	(function() {
		'use strict';
		
		var home = {};
		
		/**
		 * Implementation of hook.initialize()
		 * This will be called once when the server starts
		 */
		home.initialize = function () {
			
		};
		
		/**
		 * Theme callback
		 * @return {String}
		 *		Return the HTML for the home page
		 */
		home.getHTML = function() {
			return global.cliste.core.theme.process('home');
		};
		
		/**
		 * Implementation of hook.addTheme
		 * Add a new theme definition to the theme registry
		 */
		home.addTheme = function (callback) {
			// add a new theme for the home page
			callback({
				'home': { // name it home
					'parent': 'page', // make it's parent page.handlebars
					'view': global.cliste.core.file.getSource('module', 'home', 'template/home.handlebars'), // set the view as the source of home.handlebars
					'model': { // pass the model
						'text': 'frontpage'
					}
				}
			});
			
		};
		
		/**
		 * Implementation of hook.config()
		 * This will return configuration options for this module
		 */
		home.config = function () {
			return {
				'weight': 0
			};
		};
		
		/**
		 * Implementation of hook.addPath
		 * Add a new path to the path registry
		 */
		home.addPath = function (callback) {
			
			callback({
				'/home': {
					'type': 'module',
					'name': 'home',
					'callback': 'getHTML'
				}
			});
			
		};
		
		/**
		 * Implementation of hook.addAlias
		 * Add a new alias to the alias registry
		 */
		home.addAlias = function (callback) {
			
			// add a new alias, and point it at the home page
			callback({
				'/': '/home'
			});
			
		};
		
		/**
		 * Set listeners for emitter hooks
		 */
		global.cliste.tools.emitter.on('initialize', home.initialize);
		global.cliste.tools.emitter.on('addTheme', home.addTheme);
		global.cliste.tools.emitter.on('addPath', home.addPath);
		global.cliste.tools.emitter.on('addAlias', home.addAlias);
		
		/**
		 * Return the user module to the global scope
		 */
		module.exports = home;
		
	}());

Compatibility

  1. Requires Node.js
  2. Requires Handlebars.js
  3. Requires MongoDB
  4. Requires Mongoose

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago