Building Pages

This article will teach you how to create and import pages into your website using JSON. The JSON file below creates a new web page called "History" using existing templates in the website. Simply zip up the config.json file below and select it when clicking 'Import Package'. Conversely, you can follow this format and create multiple pages in your config.json file to be used as your first, base template.

Within your config.json file, the pages property accepts the following keywords: 

Name Description
name The name of the page
title The title of the page
to_path Whether the page will be stored in web files or www
template The path of the actual template
content An array of elements relating to the content of a page
area The dynamicDiv (dropzone) where the various files will be placed
type Types can be files, templates, or modules
from_path The location of the page in the zip file
{
    "pages": [{
        "name": "history",
        "title": "history",
        "to_path": "www",
        "template": "web files/themes/business-theme/contentTemplateSansLeftNav",
        "contents": [{
            "area": "dd.0.1.1",
            "type": "file",
            "from_path": "web files/content/about-us.html"
        }, {
            "area": "dd.0.4",
            "type": "file",
            "from_path": "web files/managers/contact-form/footer-contact-form.tpl"
        }]
    }]
}

After changing the content of about-us.html to history.html and clicking publish you will see the screen below:

Now we can take a look at how our new page about company history appears live on the web:

Creating Children Pages

You can also create children pages with your config.json file. This allows you to both create a parent and any subpages. Below is code that will create the parent "Services" page, as well as its children "Design", "Marketing", "Programming", "Sales", "Support", and "Training".

{
		"name": "services",
		"title": "Services",
		"menu_name": "Services",
		"to_path": "www",
		"template": "web files/themes/business-theme/contentTemplate",
		"structure_page": 0,
		"rank": 3,
		"meta_description": " ",
		"meta_keyword": " ",
		"children": [{
			"name": "design",
			"title": "Design",
			"template": "web files/themes/business-theme/contentTemplate",
			"meta_description": " ",
			"meta_keyword": " ",
			"contents": [{
				"area": "dd.0.0",
				"type": "empty"
			}, {
				"area": "dd.0.1.1",
				"type": "file",
				"from_path": "web files/content/services/design.html"
			}]
		}, {
			"name": "marketing",
			"title": "Marketing",
			"template": "web files/themes/business-theme/contentTemplate",
			"meta_description": " ",
			"meta_keyword": " ",
			"contents": [{
				"area": "dd.0.0",
				"type": "empty"
			}, {
				"area": "dd.0.1.1",
				"type": "file",
				"from_path": "web files/content/services/marketing.html"
			}]
		}, {
			"name": "programming",
			"title": "Programming",
			"template": "web files/themes/business-theme/contentTemplate",
			"meta_description": " ",
			"meta_keyword": " ",
			"contents": [{
				"area": "dd.0.0",
				"type": "empty"
			}, {
				"area": "dd.0.1.1",
				"type": "file",
				"from_path": "web files/content/services/programming.html"
			}]
		}, {
			"name": "sales",
			"title": "Sales",
			"template": "web files/themes/business-theme/contentTemplate",
			"meta_description": " ",
			"meta_keyword": " ",
			"contents": [{
				"area": "dd.0.0",
				"type": "empty"
			}, {
				"area": "dd.0.1.1",
				"type": "file",
				"from_path": "web files/content/services/sales.html"
			}]
		}, {
			"name": "support",
			"title": "Support",
			"template": "web files/themes/business-theme/contentTemplate",
			"meta_description": " ",
			"meta_keyword": " ",
			"contents": [{
				"area": "dd.0.0",
				"type": "empty"
			}, {
				"area": "dd.0.1.1",
				"type": "file",
				"from_path": "web files/content/services/support.html"
			}]
		}, {
			"name": "training",
			"title": "Training",
			"template": "web files/themes/business-theme/contentTemplate",
			"meta_description": " ",
			"meta_keyword": " ",
			"contents": [{
				"area": "dd.0.0",
				"type": "empty"
			}, {
				"area": "dd.0.1.1",
				"type": "file",
				"from_path": "web files/content/services/training.html"
			}]
		}],
		"contents": [{
			"area": "dd.0.0",
			"type": "empty"
		}, {
			"area": "dd.0.1.1",
			"type": "file",
			"from_path": "web files/content/services/index.html"
		}]
	}

0 Comments

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