Developing NetVIOS Templates

1.0 NetVIOS Feature

2.0 Default Location of Site-Wide Features

3.0 Creating an HTML Page with Features

4.0 Creating NetVIOS Home Page Templates

Part of the objectives of NetVIOS as a website base is to provide a consistent, manageable, and scalable look for the site. To do this, the system has a set of site-wide features. This includes variables such as background color, image, default font colors, layout features such as page size etc. The developer of a NetVIOS-compatible application can then assume these variables and use them on his application pages so that when installed, the application will automatically assume the same look as the site. The scalable aspect of NetVIOS' task allows developers and NetVIOS users to add their own features without additional programming and the NetVIOS process will adopt them and also present them to the site owner or administrator to set or modify them at any time.

1.0 NetVIOS Feature

The NetVIOS feature is an object with some of the following properties and method:

Properties

Name

Type

Scope

Default Value

Value

IsCookie

Method

ProcessFeature

Below is an explanation of some of the properties of the NetVIOS feature. For a detailed list of the feature property and methods, check the NetVIOS API documentation.

Name

This is used to identify the feature. For example, a feature named "sitebackcolor" can be called and inserted later in an html page using ASP (or even PHP) scripting methods. The name of the feature should be unique by scope

Type

The feature type may be a string, a color, a size, a dimension, etc. A site background color for instance will use a NetVIOS color type when declaring it as a feature. Actually, there are more than thirty NetVIOS GUI types. A list can be found in the programmer API.

Scope

A NetVIOS feature may have a site-wide scope, an application-wide scope or a page-wide scope by using the strings Site, Application or Page as the scope value.

NetVIOS takes a feature declared on a page and archives it the first time so that the owner or administrator of the page can set the value of the feature from an administrative page. The platform also handles caching of features so that features that are frequently requested are quickly delivered and there is hardly any noticeable degradation in speed from a direct html document of the feature. NetVIOS features may also store non-html variables and properties that the developer wishes to use at run time in an application.

ProcessFeature

The ProcessFeature method assimilates the declared feature. It registers it if the feature is been encountered the first time ever, sends it to the cache, and determines its value (default value if it has never been set).

 

2.0 Default Location of Site-Wide Features

It would be ideal to install an application on your website and have it automatically look custom to your site. Making use of NetVIOS’s feature functions, the developer may programmatically access the site’s look-based variables. The script file _sitepreferences.asp contains the default declared site features and should be server-side included on pages in which you wish to use these features.

The developer may also take advantage of NetVIOS’s feature commands to define additional site-wide or application-wide features. In this context, features are simply html variables such as color, dimensions, image URLs, or they may be strings or other quantities that you wish to programmatically change to affect the behavior of the software after installation. For instance, a feature may determine if you wish to allow non-registered site members perform an application’s function. The site owner or installer may set this feature after installing your software. Features may also be declared as cookies in which case it is the individual site user that causes its modification or modifies its value as needed.

 

3.0 Creating an HTML Page with Features

The easiest way we have found to using NetVIOS features on asp (html) pages is as follows:

  1. Create the page first as html
  2. Determine which aspects of the page will be variable or modifiable by the user or site administrator
  3. Determine if the feature is already a default site feature (such as background color)
  4. Decide the scope you wish to give the feature (site, application or page).
  5. Give a unique name to the features by scope
  6. Insert scripts at the top of the page (in asp or php) to create the features by the names you have given them
  7. Replace the html tags for the features (new and default) with their variable names in asp.

Examples abound in the NetVIOS pages you have received of how this is done.

 

4.0 Creating NetVIOS Home Page Templates

Creating a NetVIOS home page template follows the same methods as above. NetVIOS home page templates may be wholly html or html files enriched with NetVIOS features to make them modifiable by site (this effectively converts one template into several depending on its implementation by site).

NetVIOS provides additional commands for assimilating a home page template.

A NetVIOS home page must be adopted from the _registernewsite.asp page. Using this page is straightforward but must be done at the initialization of the website. The document on installing NetVIOS describes how to initialize NetVIOS after installation.

WARNING: Initializing a NetVIOS site resets all site-wide features to their default value so care must be taken in resorting to this activity on an existing site.

 

Adopting a NetVIOS home page involves the following additional activities:

  1. All contents of the template between the tags
    <CUSTOMFEATURE>

    </CUSTOMFEATURE>
    are removed on adopting the page. This allows the template designer to insert scripts to force site-wide features to assume a value so that they can be examined (and look as is intended prior to adoption) on an existing site. The template designer can also place any commands within this block that is not intended to be adopted in the final home page.
  2. Commands to copy relevant accompanying files (such as images) may be embedded within the tags
    <FILESTOCOPY>
    source path, destination path
    </FILESTOCOPY>
    The adoption process will copy the files and modify all existing links referring to the file or resource in the page to the new path.
  3. Accompanying header files are adopted with the process. The header files must be XML and included in two files - one for the header information and the other for the header cell information. (The best way to create NetVIOS XML header templates for the novice is to create the header in NetVIOS and generate the header. NetVIOS will create the XML version).
    The header files must be named similar to the home page template and be in the same directory.
    The header file names for a template name template.asp is
    _h1-template.xml
    _c1-template.xml
    for the main header and
    _h2-template.xml
    _c2-template.xml
    for a side header if one exists for the template.
    The adoption process makes this header the site default.

Note that these additional adoption functions are available to the home page template creator but are not essential. A very good home page template can be created in html. A home page template that can be modified iin color and look by the site owner can be created simply with html and NetWIOS features.