Building Packages Overview

The following chapter will show you how to build your own custom theme using json to import into Solodev while at the same time giving you great insight into both the web page and application architecture in Solodev CMS.

Building a package allows you to create a fully functional website and deploy it to any Solodev installation. You can use packages as a base starting point on a new project, for testing purposes, as a means of project deployment, or any number of applications. Before you reach this point, however, you should have a finalized design and clear sitemap.

At its core, every package is simply a collection of folders, template files, and content that will be placed in the web files folder in Solodev. Every package must also contain a "config.json" file which is used to install your package and create web pages as well as modules. Below is the basic structure of a package:

 

You can upload the zip file of any package to Solodev during the "Website Type" stage of setting up a website in Solodev CMS. This allows you to import a fully functional website to any domain you specify.

Note: Your zipped package must contain all contents in its root. You will receive an error if your zipped package has everything under an additional folder.

About config.json

The "config.json" file is the principle controller for any given package. This file specifies what folders need to be imported into Solodev. You can additionally specify what modules, users, and pages you want to create by default. This will allow you to create datatables, calendars, and populate them. Below are some key concepts and samples for the "config.json" file.

While not necessary, it is generally best practice to include a version number and a name for your package. At it's most basic, the config.json file includes the following

Name
Description
version The version of the config.json file
name The name of the package
folders An array of the folders you want to build out
users An array of users you want added by default (optional)
modules An array of the modules you want to build out (optional)
pages An array of the pages you want to build out
templates/themes An array of template files you want to build out and consistently use on the site.
{
	"version": "1.0",
	"name": "Solodev Business Package",
	"folders": [{
		"from_path": "content",
		"to_path": "web files/content"
	}, {
		"from_path": "themes",
		"to_path": "web files/themes"
	}, {
		"from_path": "modules",
		"to_path": "web files/modules"
	}, {
		"from_path": "forms",
		"to_path": "web files/forms"
	}],
        "users": [{
                "first_name": "first",
		"last_name": "user",
		"username": "first@user.com",
		"email": "first@user.com",
		"password": "password"
	}, {
                "first_name": "another",
		"last_name": "user",
		"username": "another@user.com",
		"email": "another@user.com",
		"password": "password"
	}],
        "modules": [{
		"module_type": "Calendar",
		"to_path": "web files/managers/news",
		"name": "News",
		"form_template": {
			"file_path": "managers/news/news-form.tpl"
		},
		"display_template": {
			"file_path": "managers/news/repeater.tpl"
		},
		"detail_display_template": {
			"file_path": "managers/news/detail.tpl"
		},
		"html_template": "www/news/detail.stml",
		"dependent_templates": [{
			"name": "home-news.tpl",
			"from_path": "managers/news/",
			"to_path": "web files/managers/news/"
		}, {
			"name": "news-custom-repeater.tpl",
			"from_path": "managers/news/",
			"to_path": "web files/managers/news/"
		}]
	}],
        "pages": [{
		"name": "index",
		"title": "Home",
		"to_path": "www",
		"template": "web files/themes/business-theme/homeTemplate",
		"contents": [{
			"area": "dd.0.1.0",
			"type": "file",
			"from_path": "web files/managers/news/home-news.tpl"
		}, {
			"area": "dd.0.1.1",
			"type": "file",
			"from_path": "web files/content/home/homeSection1.html"
		}, {
			"area": "dd.0.4",
			"type": "file",
			"from_path": "web files/managers/contact-form/footer-contact-form.tpl"
		}]
	}],
        "templates": [{
		"name": "blankTemplate",
		"from_path": "themes/business-theme",
		"to_path": "web files/themes/business-theme"
	}, {
		"name": "contentTemplate",
		"from_path": "themes/business-theme",
		"to_path": "web files/themes/business-theme"
	}, {
		"name": "contentTemplateSansLeftNav",
		"from_path": "themes/business-theme",
		"to_path": "web files/themes/business-theme"
	}, {
		"name": "homeTemplate",
		"from_path": "themes/business-theme",
		"to_path": "web files/themes/business-theme"
	}]
}

As seen above, your config.json file needs to follow standard JSON formatting rules including opening and closing brackets. 

Note: Please see the attached zip file below for an example of a Solodev Theme/Package. You can use this package as a frame of reference when building and importing your own themes.

0 Comments

Please sign in to leave a comment.
Have more questions? Submit a request