Sparkplug Content Management System User Manual by lcs51830

VIEWS: 20 PAGES: 37

									Sparkplug Content Management System User Manual
                                             TABLE OF CONTENTS


INTRODUCTION...........................................................................................................

INSTALLING SPARKPLUG CONTENT MANAGEMENT SYSTEM ........................................

THE SPARKPLUG INTERFACE .......................................................................................

HOW SPARKPLUG WORKS ...........................................................................................

CREATING A NEW SITE ................................................................................................

ADDING NEW USERS ...................................................................................................

CREATING NEW SECTIONS
 Section Look-and-Feel
 Section Template Backup

CREATING NEW SECTION TYPES .................................................................................

ADDING NEW IMAGES
  Uploading Static Images
  Adding Dynamic Images
 Browsing Images........................................................................................................

UPLOADING MEDIA FILES ...........................................................................................

UPLOADING DOCUMENT FILES ....................................................................................

ADDING SITE CONTENT
 What next?................................................................................................................
 Content Versioning
 Content Scheduling.....................................................................................................
 E-mailing Content

PUBLISHING YOUR WEB SITE......................................................................................
 Publish Section Pages..................................................................................................
 Publish Content Pages
 Publish RSS 2.0 Feed
 Publish To FTP Server

GOING LIVE.................................................................................................................

I. APPENDIX: INTRODUCTION FOR DEVELOPERS

II. APPENDIX: DATABASE TABLES & QUERIES
   The Built-in GetContent Query
   Writing Your Own Queries

III APPENDIX: TIPS AND TRICKS ................................................................................
  The Demo Site
  Shared Template Components
  Implementing Sub-sections
  Building Single-Section Sites
  Creating Automatic Menus
INTRODUCTION

Welcome to the Sparkplug Content Management System (CMS) for the Macromedia
Coldfusion platform. Sparkplug, developed by 13amp.com, is a powerful Web
browser-based content management system that allows you to quickly take advantage
of the Coldfusion platform to create database-driven static or dynamic Web sites,
intranets and portals. No knowledge of Coldfusion is required, although some
knowledge of CFML will allow Web developers to customize the system to meet certain
site-specific requirements.

Sparkplug differs from entry- to mid-level Web site management systems because it
does not force Web developers to build their sites in a predefined way. Instead, it
provides developers with a flexible site-building system that allows Webmasters to,
with a bit of imagination, architect, manage and serve any kind of Web site.

Sparkplug Content Management System is the result of years of experience developing
corporate Web sites and portals for leading companies around the world. Developed to
run on the cost-effective Coldfusion platform from Macromedia and priced like a custom
tag or CGI application, Sparkplug offers features found in content management
systems that cost hundreds of thousands of dollars.

In addition, while these expensive content management systems require months of
development and specific programming skills to get a new Web site up and running,
Web developers, designers and non-technical company staff can start working together
to create powerful sites in Sparkplug in a matter of minutes.

Sparkplug Content Management System offers site developers and contributors the
following features:

∀ Built-in WYSIWYG HTML Editor
∀ Multiple Web sites
∀ Multiple Languages
∀ Multiple users
∀ Writer, Editor, Publisher and Admin user roles
∀ Built-in image and media management
∀ Editorial workflow and content approval system
∀ Content scheduling
∀ Content versioning
∀ Content ranking
∀ Dynamic or static Web sites
∀ Personalized user workspaces
∀ Remote FTP publishing
∀ E-mail content to live site
∀ RSS Feed creation
∀ RSS Feed importing
∀ User e-mail notification and much more

Sparkplug offers site developers all the tools they need to create database-driven
Web sites to which non-technical can contribute using only a Web browser.
INSTALLING SPARKPLUG CONTENT MANAGEMENT SYSTEM

Sparkplug Content Management System (CMS) is a Coldfusion application and requires
at least version 4.5 of Macromedia Coldfusion running on Microsoft Windows. The
software can also run on other Coldfusion platforms such as Linux.

Installation Directory
Sparkplug CMS is delivered as a single executable or ZIP, which copies the application
templates and related files into c:\sparkplug5, c:\cfusionmx\wwwroot\sparklug5 or another
location of your choice. No changes are made to your system registry so you can
remove the software simply by deleting the sparkplug5 folder.

After installing the application you need to create a Coldfusion datasource for the
Sparkplug database using the Coldfusion Administrator or instructing your hosting ISP
to create the datasource. The instructions below assume your installation is on
Coldfusion MX. Instructions for other versions of Coldfusion may vary but the principle
remains the same.

ODBC Data Sources
Sparkplug ships with a Microsoft Access database called SparkPlug.mdb. A .sql file is
also provided for importing into mySQL or other databases that support .sql files. To set
up the ODBC data sources for the database, log in to the Coldfusion Server
Administrator and click on ODBC (4.x) or Data Sources (MX). In the CF Data Source
Name input box enter Sparkplug5 and in the ODBC Driver select box choose Microsoft
Access Driver with Unicode. Click the Add... button. On the following screen enter the
location of the SparkPlug.mdb file (e.g. c:\sparkplug5\database\sparkplug.mdb) in the
Database File text box or Browse to the sparkplug.mdb database file on your server.
Leave the other fields untouched and click the Create button.

Make sure that the datasource is verified by clicking the Verify link next to the
Sparkplug5 datasource.

Note: You can name the datasource something other than Sparkplug5 and configure the
software accordingly. The Access databases can be upsized to Microsoft SQL Server databases
using the Upsize Wizard that comes with SQL Server. Refer to your SQL Server documentation for
upsizing details.

Coldfusion Administrator Settings
Sparkplug needs a number of Coldfusion Administrator settings to be enabled to
function correctly. In the ColdFusion Administrator, click on Memory Variables. Enable
Application Variables and Enable Session Variables must be selected. Sparkplug uses
the default Timeout settings for both Application and Session variables although you
may customize the timeout to your setup if you so wish. If your version of Coldfusion
allows you to do this, be sure to enable the CFCONTENT, CFDIRECTORY and CFFILE
tags. These tags are necessary for the Sparkplug application to function fully.

Configuring Web Server Software
To use the Sparkplug Admin interface locally or over the Internet you need to set it up
as a virtual site under IIS or another Web server. Coldfusion MX comes with a built-in
Web server which you may use instead of a separate Web server. Refer to your MX
documentation for configuring the built-in Web server.

In previous versions of Coldfusion, you set up a virtual site in your Web server called
Sparkplug5 and point it to c:\sparkplug5 (Coldfusion 4.X). Set the default document to
index.html. In Coldfusion MX you simply install Sparkplug within the wwwroot folder
located at: C:\CFusionMX\wwwroot.

You can then access the Sparkplug Admin interface using http://localhost/sparkplug5,
http://127.0.0.1/sparkplug5 or a domain name or IP address of your choosing if the
application will be accessed over the Internet. If you are using the built-in Web server
in MX, you access the admin interface at http://localhost:8500/sparkplug5,
http://127.0.0.1:8500/sparkplug5 or http://www.mydomain.com:8500. 8500 is the port on which
Coldfusion MX’s built-in Web server can be accessed by default.

Use your Web server security and/or a firewall to avoid unauthorized access to the
Sparkplug admin interface.

Configuring Sparkplug
Previous versions of Sparkplug required manual configuration of two Application.cfm
files. One located in the \sparkplug5 directory and the other in the \sparkplug5\_Admin
directory. Essentially, the one in _Admin controls behaviour and look-and-feel of the
Admin interface while the other does the same for Sparkplug web sites.

Later versions of Sparkplug introduced a convenient Configure button that allows you
to configure the system without manually editing the Application.cfm files. The
Configure button can only be used by the default administrator.

The default setting in the Configure form are as follows:

Install Directory Path:        C:\CFusionMX\wwwroot\sparkplug5
Install Directory URL:         http://localhost:8500/sparkplug5
Coldfusion Datasource:         sparkplug
Sparkplug Admin Font:          Verdana
Display Items per Page:        10

After saving the configuration settings, you may log in with the default Admin
username: admin and password: sparkplug. This gives you Site God privileges so
remember to change the password.

Manually Edit the Application.cfm files
If you are feeling brave, you may also set these parameters manually in the
Application.cfm files.

Open the two Application.cfm files one at a time in a text editor like Notepad and
change the directories and URLs in the following lines according to your installation
directory and Web server setup. The settings that need changing look something like
this:

<CFSET application.path = "c:\cfusionmx\wwwroot\sparkplug5">
<CFSET application.url = "http://localhost:8500/sparkplug5">


Feel free to change the IP address to localhost or fully qualified domain names such as
www.mysite.com. Do not modify the other lines. Save the Application.cfm files and then
access the Sparkplug Admin interface by typing its url in your browser -
http://localhost/sparkplug5 or http://127.0.0.1/sparkplug5 or http://localhost:8500/sparkplug5
(MX).
NOTE: Default username is admin and password is sparkplug.

This gives you Site God privileges so remember to change the password. Once logged
in as the Default Admin, you can then create new sites, users etc. in Sparkplug.
THE SPARKPLUG INTERFACE

The Sparkplug user interface is very intuitive. It consists of Navigation Buttons for
accessing key functions such as Publishing, Scheduling, Uploading and the
personalized Workspace, a Navigation Bar for site management activities, a Site Info
Bar displaying the current site, user and the user’s site privileges, a Site Tree for
previewing the “Live” dynamic or static version of your site and a Main Area where most
content management activity takes place.

The Navigation Buttons:
At the top of the Sparkplug interface are the four Navigation Buttons: General, Publish,
My Workspace and Schedule. Users can access features behind these Navigation
Buttons depending on their role for the site. For example only users with Admin or
Publisher roles can access the Publish or Schedule functions.

The Navigation Bar:
The Navigation Bar is located below the Navigation Buttons. It has four dropdown lists:
New, Browse, Upload and Search. The New drop-down list lets users with the relevant
privileges add new sites, users, content, sections and so on to the system. The Browse
drop-down list lets you browse sites, users, content, sections, and so on that you have
already created. The Upload drop-down list lets you upload images, documents and
media that you can call explicitly in your site templates.

The Site Info Bar:
Just below the Navigation Buttons and to the right of the screen, you'll find the Site Info
Bar, which displays the name of the current site, the current user and their site
privileges.

The Site Tree:
The Site Tree allows you to easily preview Dynamic or Static HTML versions of your
“Live” Web site depending on whether the Type setting for your site is Dynamic or
Static. Clicking a folder will load the relevant Section template for that section.
Expanding a folder displays any content currently assigned to that section with a status
of “Live”.

The Logout Box:
Below the Site Tree are the REFRESH, USER MANUAL and LOGOUT links. Clicking
REFRESH reloads the Site Menu to reflect any changes. Clicking LOGOUT logs you out
of the system.

The Main Area:
The Main Area is where most of the action takes place in Sparkplug. When the user first
logs in, the Main Area displays the Site name, the site type (HTML) and the encoding
language. It also notifies the user if any content has been assigned to them for editing
or approval. Clicking the number of assigned content items takes you to into your
workspace where you can work on the content.
HOW SPARKPLUG WORKS

Sparkplug Content Management allows Web developers and Webmasters to separate
the design of their sites from the content. Instead of building hundred of Web pages
one at a time, developers can use templated sections to determine what the sites pages
will look like. These pages automatically retrieve content from a database and display
the resulting Web page to the user using the assigned section templates. Sparkplug
allows both technical (E.g. Webmaster) and non-technical users (E.g. Company
Secretary) to work together in a Web-based environment to deliver up-to-date
information to customers and end users via a dynamic or static Web site.

Sparkplug offers flexibility for Webmasters to create powerful Internet portals or simple
corporate Web sites by using a well-defined architecture based on the relationship
between Sections and Content. The best way to define this relationship is through an
example.

Imagine a news Web site called MyPortal with three sections: News, Entertainment and
Sports. Each section will have it’s own look-and-feel and each section will have an index
page that shows a list of headlines or stories.

To set up this site in Sparkplug, a user with Admin privileges will create a new site
called MyPortal using the New Site function and optionally a new user for the site using
the New User function. The next step would be to log in to the new site and create the
three sections using the New Section function: News, Entertainment and Sports. Each
section can be given a unique header and footer which will be used for all pages in this
section.

Use your favourite Web page design software, such as Macromedia Dreamweaver or
Microsoft FrontPage, to design the section templates. The templates should be divided
into header and footer and copied and pasted to the Header and Footer fields in the
New Section form. The dynamic Coldfusion code that will retrieve content from the
database is added to the template automatically and can be modified by simply editing
the section. This way, Webmasters only need the HTML code of their templates and
Sparkplug will handle the data retrieval.

Images and other media (E.g. Flash) used by the Section templates can be uploaded to
the system using the New Image or New Media functions. Once the Sections have been
created, the next step is to add content and assign it to one of the sections.

Once the Sections have been created as in the example above, no further development
work is required. Non-technical users can simply add new content using the input forms,
send it through the editorial workflow and the section templates will do the rest. Below
you'll find a more detailed step-by-step guide on how sites are created and managed in
Sparkplug CMS.
CREATING A NEW SITE

Creating a new site in Sparkplug is as easy as selecting Site from the New dropdown list.
The New Site input form is displayed. Give the new site a one-word name – such as
MySite - and choose a Site Mode and a Language. The default Site Mode is Dynamic. In
previous versions of Sparkplug this was the only mode available. Later versions
introduce a new Static mode. You can publish static HTML pages in both Static and
Dynamic mode, the only difference is that in Static Mode the Site Tree will preview only
published HTML files (filename.html) instead of dynamic urls (content.cfm?id=2). In
addition the dynamic code for new section templates generates links to Static HTML
files instead of dynamic ones.

Choose a Static mode if your site will be composed of static HTML files (i.e. it will be
published using Sparkplug’s Publish feature) or Dynamic if your site will be composed
of both dynamic and static pages. If unsure, choose Dynamic mode and preview any
Static HTML files you may have from the Browse Content and Browse Section screens.

It is recommended that the Site Language is set to Multilingual.

The optional Remote FTP Publishing fields are used if you would like to publish static
HTML files created in Sparkplug to a remote FTP server (you can also fill in these fields
from the Remote FTP Publishing screen so no need to do so here). This feature allows
Sparkplug-created sites to be hosted with practically any ISP because the sites would
run on any Web server without requiring that Coldfusion be installed.

When a new site is created in Sparkplug, a folder with the same name as the site is
created under the Sites directory. All section templates, images, static HTML files and
so on are stored below this folder.

The structure of a new site folder is as follows:

/Sites
         /MySite
                /cfml
                /html
                /media
                /docs
                /images
                /rss
                content.cfm
                section.cfm

Section templates are stored in the cfml directory. Uploaded images, documents (such
as PDFs) and media files (e.g. Shockwave Flash) are stored in the images, media and
docs folders respectively. Published static (.html) versions of sites are stored in the html
folder along with copies of the images, media and docs folders so that references to these
folders do not need to change depending on whether your site is static or dynamic.

Note: You can edit information for a site (except the site name) or delete a site at anytime by
selecting Site from the Browse drop-down list and clicking Edit. Remote FTP publishing settings
can also be added or modified later from the Publish to FTP window.
ADDING NEW USERS

While the Default Admin user account has Site God privileges and can access any site
in Sparkplug, other users are tied to a specific Web site. After creating a new site, you
may want to create a user other than Default Admin who has administrative privileges
for that specific Web site. To do so, simply select User from the New drop-down box.

In Sparkplug, users have specific roles that determine what they can do within
Sparkplug and their roles within approval content processes. Users must have at least
one of the following four roles.

∀ Writer - Can add and browse content and images only [Non-technical]
∀ Editor - Can add, edit, browse and delete content and images [Non-technical]
∀ Publisher - Can publish static HTML files, import and export RSS feeds, and schedule content [Semi-technical]
∀ Admin - Can do all of the above as well as manage users, sections and section types [Technical]
∀ Default Admin – Can do everything including creating new sites

To add a new user, select User from the New drop-down list then click GO. In the Add
User form, type the user's full name, e-mail address (enter this if you wish to take
advantage of E-mail Notification when new content is assigned to the user), username
and password. Finally, assign at least one role to the new user and select the Site that
they can manage. Click the Add User button to save the user’s details. You can then
logout and log into your new site as the new user.

Note: To edit a specific user’s information or delete that user, select User in the Browse drop-down
list and click GO. A list of users appears showing their details. You can then Edit or Delete any user.
Deleting yourself is by no means a clever idea.
CREATING NEW SECTIONS

After creating a new site and assigning at least one new user to it with at least Writer
and Editor privileges, the next step is to create a new section for the site. In Sparkplug,
all sites have at least one section. A corporate Web site with the same look-and-feel
throughout might only need one section and its related header and footer to handle the
entire site. A news portal on the other hand will require multiple templates, each with
a different layout and design.

To create a new section in Sparkplug, select Section from the New drop-down list and
click GO. In the Add New Section form, enter a name for your Section (e.g. Front Page
or Games or Sports). The Rank field is important. It indicates that this section will hold
content. It is also useful for Coldfusion- or Javascript-savvy users who wish to generate
dynamic menus. The Rank should be a number from 1 to any number you wish. So if
you have 10 sections, you can rank them from 1 to 10. The rank will determine the
order in which sections will appear in your dynamic menu. In addition, only sections
with a rank can be published to static pages. This way, if you have sections that simply
hold content that don’t need to be published or that are included in other templates,
you simply don’t assign these sections a rank.

Section Look-and-Feel
The Header and Footer fields in the Add New Section form allow you to design the
look-and-feel and layout of individual section of your Web site. All future content
assigned to this section inherit that same look-and-feel and layout. The Header and
Footer fields determine how content assigned to different sections of your Web site will
appear when viewed in a browser.

In Sparkplug, there are two kinds of pages. Index Pages containing a list or index of
content assigned to that section (e.g. headlines and abstracts) and Content Pages
which display the a single content page such as an article or a product page. Index
Pages are called by Sparkplug using a section.cfm file while Content Pages are called
using a content.cfm file. Both files combine your Header and Footer with dynamic code
to retrieve the content dynamically from the database. By customizing headers and
footers for each section and editing the dynamic code generated by Sparkplug, you can
build sophisticated news portals. For corporate Web sites in which all pages look the
same and no index pages are required, a single Section and a single header and footer
can be used for the entire site.

To add a Header and a Footer to a new section, separate the HTML code of your
templates (built with Web design software such as FrontPage or Dreamweaver) into a
header and footer and paste them into the Header and Footer fields. The CFML code to
dynamically display indexes and content ages will be added when you save the section.
You can edit the section later to modify the generated CFML code as well as your
Header and Footer code.

You won't be able to view your new Section in the Site Tree until you assign new
content to the section and set the Status of the content to “Live”. You can preview
Sections at any time by selecting Section in the Browse dropdown list and clicking the
Go button. Preview a section either by clicking its dynamic URL, .cfm file (used for
<cfincludes>) or its static HTML file if the section has been published before.

To edit or remove a template, select Edit or Delete respectively. Be careful when
deleting Sections as all related content is also deleted, which may affect your "live" site.
Note: Only users with Admin privileges (usually the site’s Webmaster) can add Sections. To edit or
remove a section, select Section in the Browse drop-down list and click GO. A list of sections
related to the current site is displayed. Click Edit or Delete depending on what you’d like to do with
the section.


Section Template Backup

The following files are automatically created at the time each Section is saved. The files
are saved in the cfml folder as:

SECTION_NAME.cfm (a .cfm file for the section that calls all required code)
SECTION_NAME_header.cfm (the section header)
SECTION_NAME_footer.cfm (the section footer)
SECTION_NAME_scode.cfm (the dynamic CFML code for the section index)
SECTION_NAME_pcode.cfm (the dynamic CFML code for content pages assigned to the
section)

Original and edited backups of the above are also automatically created and saved in
the same location with _bak identifier.
CREATING NEW SECTION TYPES
Sparkplug comes with 6 default Section Types - with Content (Default) being the standard type
used for generic Web content. These Section Types determine the type of content Sections display
and how they display them. The default Section Types are:

Content (Default)
Store
Jobs
Directory
Gallery
Property

It is important to note that these Section Types all use the same Content table in the Sparkplug
database. The idea of Section Types is that you can use the structure of the Content table to
display different types of content such as products in an online store or entries in a link directory.
The Content (Default) Section Type is used for generic site content while the others have very
specific uses. E.g. Store allows you to enter product-related content with external links to payment
systems such as PayPal. The Gallery Section Type allows you to create image galleries and so on.
Only experienced Webmasters or developers should create new Section Types, as this basically
means that you are extending Sparkplug’s functionality. Only the Default Admin can create new
Section Types.

To create a new Section Type, select Section Type in the New drop-down list. Enter a name for the
Section Type, e.g. Classifieds. Sparkplug automatically inserts default dynamic code in the Index
Code and Page Code field. You may edit this code or leave it as it is. Next, in the New Form and
Edit Form fields enter the full filename of the .cfm forms pages that will allow you to input and edit
data for the new Section Type. E.g. new_classifieds_form.cfm and edit_classifieds_form.cfm. Click
Add Section Type. The new Section Type will be created and default versions of the two forms you
entered will be automatically created by Sparkplug and saved to the _admin folder. You'll now be
able to select the new Section Type when you add new Sections, and the new Sections will inherit
the layout and formatting of the new Section Type. Finally, go to the _admin folder and open the
automatically created new_classifieds_form.cfm and edit_classifieds_form.cfm files in Notepad
and change the labels of form input fields to match your new Section Type. For example you may
change labels as follows:

Headline: => Classifieds Item:
Author: => Posted By:
Abstract: => Classifieds Summary:
Body: => Classifieds Description:

Only change the form field labels. Do not change the name of the existing form fields e.g. <input
type="text" name="Headline" size="25"> otherwise you will receive an error when you add data.
Changing the field labels simply allows you to customize the input forms in a way that relates to the
Section Type you are creating. By allowing the creation of Section Types, you can customize how
content assigned to related sections is displayed on your site
ADDING NEW IMAGES

There are two types of images in Sparkplug: Static Images that are referenced directly
by your site templates and Dynamic Images that are called dynamically by your section
indexes and individual content pages. Both types of images are stored in the images
directory of each site. Static Images are called with relative URLs such as <img
src=”images/imagename.gif”> and Dynamic Images are called dynamically by Sparkplug code
using URL variables such as <img src=”images/#images#”>.

Dynamic Images are stored in the Sparkplug database while Static Images are not.
Static Images don’t need to be dynamically served from a database. Dynamic Images,
on the other hand, are used when you want to associate a specific image with specific
content and you want to be able to call that image when the content it is assigned to is
retrieved. For example, an article about George Bush can be assigned a Dynamic
Image which is a photograph of George Bush. The photo will then be called dynamically
together with the article in your Content Template. Because the image is in the
database it can be called together with the headline, abstract or body of an article or
piece of content using a database query. Dynamic Images can also carry a caption and
their width and height can be stored in the database.

Static Images are uploaded directly from your PC to the images directory for your site
using the Upload drop-down list. When an image is uploaded using the Upload Tool, a
copy of that image is stored in both the images directory for your site and the images
directory located under the html directory of your site. This is so that if you publish your
site to static HTML pages, you don’t have to change the image references in your
templates.

Uploading Static Images
Static Images are possibly the first types of images that you’ll add to Sparkplug. These
are the images referenced in your Section headers and footers using something like
<img src=”images/imagename.gif”>. After adding a new Section to Sparkplug, you
would typically upload all the images referenced within the Section's header and footer.
To Upload a Static Image, select Image from the New drop-down list and click GO. This
will load the Upload Tool.

Using the Browse buttons you can select up to 10 images for uploading to your site’s
images directory. Click the Upload Images button to upload the images to the server. If
you don’t want images on the server to be overwritten, deselect the check boxes. If an
image with the same name exists on the server, Coldfusion will assign a new name to
the image. The naming convention used depends on the version of Coldfusion that you
are using. Image file types accepted by the Upload tool include .gif, .jpeg, .jpg, .pjpeg.

When you upload Static Images, copies of the images are also placed in the images
folder under the html folder for your site so that relative image paths in your templates
will display the correct image regardless of whether your site is static or dynamic. You
may also remove images from the server by selecting the image on the right hand side
of the Upload Tool and clicking the Remove Image(s) button.

If you use the WYSIWYG HTML editor to add images to the body of your content instead
of calling them dynamically, you may also use the Upload Tool to add those images
beforehand.
Adding Dynamic Images
Dynamic images are stored in the Sparkplug database and are dynamically called at the
same time as content to which they are assigned. Dynamic Images are referenced
using variables, e.g. <img src=”images/#image#”>. To add a Dynamic Image to Sparkplug,
select Image from the New drop-down list and click GO. This will load the New Image
input form.

Enter a name for the image such as ‘georgebush’. There is no need to add an image
extension such as .gif or .jpg as your image will be stored with its original filename if it
doesn't exist or renamed if an image of the same name already exists. The image name
is just a convenient way for you to identify or search for your images. If your images
will have a caption, you may also enter a caption such as ‘George Bush wins Florida
vote’. Click the Browse button to select an image from your computer. Optionally, you
may specify a width and height for the image although these fields are not used by
Sparkplug generated code. You can also fix the size of the Dynamic Image by editing
the dynamic code that Sparkplug generates. The following examples demonstrate how
these fields can be used in the code.

Hard-coded Image Size:
<img src="images/#images#" align="left" width=”100” height=”80”>

Dynamic Image Size:
<img src="images/#images#" align="left" width=”#width#” height=”#height#”>

The hard-coded image reference ignores the Width and Height settings for the image,
the Dynamic version uses them. Set the Suggested field to Yes, to make the image
available on the Browse Images page. Click the Add Image button to add the image to
the database. If an image with the same name exists on the server, Coldfusion will
assign a new name to the image. The naming convention used depends on the version
of Coldfusion that you are using.

When you add Dynamic Images, copies of the images are also placed in the images
folder under the html folder for your site so that relative image paths in your Section
code will display the correct image regardless of whether your site is Static or Dynamic.


Browsing Images
You can browse Dynamic Images by selecting Images from the Browse drop-down list
and clicking GO. This will list all Dynamic Images in the database with a Suggested
status of ‘Yes’ along with thumbnails of the images. Preview an image in the browser by
clicking its thumbnail or name. Edit or delete image attributes by clicking the Edit or
Delete links. Deleting a Dynamic Image deletes its reference from the Sparkplug
database only, so that any static pages referencing the images will not get an “image
not found” error. You may remove image files from the server by selecting the image
file on the right hand side of the Upload Tool and clicking the Remove Image File(s)
button.

If the Suggested field of an image is set to ‘No’ you can browse it using the Search
drop-down list to search the Image table in the Sparkplug database. You can also use
the Search function to find a specific image based on its caption or to list all images in
the database.
ADDING MEDIA FILES

Media files such as Flash files or videos can be uploaded to the system using the Upload
Tool. These media files are referenced directly in your Section headers, footers or
dynamic code using something like <a href=”media/intro.swf” target=”_blank”>.

To add a media file, select Media from the New drop-down list and click GO. This will
load the Upload Tool. Using the Browse buttons you can select up to 10 media files for
uploading to your site’s media directory. Click the Upload Media button to upload the
media files to the server. If you don’t want media files on the server to be overwritten,
deselect the check boxes. If a media file with the same name exists on the server,
Coldfusion will assign a new name to the media file. The naming convention used
depends on the version of Coldfusion that you are using. Media file types accepted by
the Upload tool include Shockwave Flash and common audio and video media types.
The NewMedia(t).cfm template under the _admin folder can be modified to support
additional media file types if necessary.

When media files are uploaded using the Upload Tool, copies of the media files are also
placed in the media folder under the html folder for your site so that relative paths in your
Section code will display the correct media file regardless of whether your site is static
or dynamic. You may also remove media files from the server by selecting the media
file on the right hand side of the Upload Tool and click the Remove Media File(s) button.
ADDING DOCUMENT FILES

Document files used by Section and Content Templates such as PDF files or Word
documents can be uploaded to the system using the Upload Tool. These document files
are referenced in your templates using something like <a href=”docs/manual.pdf”
target=”_blank”>.

To add a Document file, select Documents from the New drop-down list and click GO.
This will load the Upload Tool.

Using the Browse buttons you can select up to 10 document files for uploading to your
site’s docs directory. Click the Upload Documents button to upload the document files to
the server. If you don’t want document files on the server to be overwritten, deselect
the check boxes. If a document file with the same name exists on the server, Coldfusion
will assign a new name to the document file. The naming convention used depends on
the version of Coldfusion that you are using. Document file types accepted by the
Upload tool include HTML, plain or formatted text, Word, Excel or Powerpoint files and
PDFs. The NewDocument(t).cfm template under the _admin folder can be modified to
support additional document file types if necessary.

When document files are uploaded using the Upload Tool, copies of the document files
are also placed in the docs folder under the html folder for your site so that relative paths
in your Section will display the correct document file regardless of whether your site is
static or dynamic. You may also remove document files from the server by selecting the
document file on the right hand side of the
Upload Tool and click the Remove Docs File(s) button.
ADDING SITE CONTENT

Content is the most important aspect of any Web site. All the steps explained in the
earlier part of this manual are for the sole purpose of making it easy to add content to
your Sparkplug-powered Web sites.

Before adding new content, make sure that a Section to which the content will belong
exists or create one. Next, select Content from the New drop-down list and click GO.
Then choose the content type you are adding, usually Content (Default) and click Select.
Follow the following steps:

    1  Choose the Section that the content belongs to
    2  Choose an Author (usually yourself)
    3  Type a headline or title for the content (e.g. Al Gore wins US presidential election or
       Check out my holiday photos!)
    4 Type an Abstract or short introduction if you plan to display the contents of this
       field in your templates
    5 Type or cut-and-paste the body of the content or article into the body field. Use
       the WYSIWYG editor to format the content. To apply fonts uniformly across your
       site you can specify fonts in the Section Code or edit the Site stylesheets by
       browsing the site and clicking Edit. These settings will override text formatting
       in the WYSIWYG editor.
    6 Select an image to assign to the content. Other images can be inserted directly
       into the content body using the WYSIWYG editor or HTML code. (e.g. <img
       src="images/myotherimage.gif">
    7 Type link text into the Link Text box if you plan to use link text such as ..continue,
       read story or Go in your Section Index.
    8 Set Suggested to Yes, if you want the article or content to appear in Browse
       mode. (Even if you set it to No, you can still find it using the Search feature or in your
       WorkSpace if you assigned the article to yourself. In later versions of Sparkplug the
       suggested field is not used in Browse mode.)
    9 Set Status to Live for it to appear on your site immediately or to Added or Edited
       to reflect its current status.
    10 Assign the content to an Editor, yourself or another user, to move the content to
       the next stage of workflow for approval
    11 Click the Add Content button to save the content!

Note: All Dynamic Images added or edited during your current session are available to
be assigned to content. You won't be able to view the article in the Site Menu until its Status has
been changed to "Live" by an Editor or another user. The default mode for content that has just
been added is "Added". The next stage is Edited and the final stage is Live. In later versions of
Sparkplug you can skip editorial workflow and make content live as soon as it’s added.

What next?
Sparkplug uses a staged approach for content. Newly added content that needs to go
through some editing or approval process can be assigned the status ‘Added’. If
content is assigned to another user, Sparkplug will notify the user that content had
been added and is awaiting their approval - either by e-mail if an address for that user
is available or on their Workspace next time they log into Sparkplug. If content is
assigned to yourself, you’ll find the content in My WorkSpace or in the main area of the
General Screen by using the Browse drop-down list and selecting Content. You can also
find content by keyword with the Search drop-down list. In any of these three locations
you can click the Edit link to change the status of the content.
Approve the added content by setting its status to ‘Edited’ or ‘Live’ depending on the
levels of approval you use within your organization. At this stage, you can also give the
content a rank using the Rank field. A rank is a number from 1 to x which can be used
to determine the order in which content headlines or other fields will be listed on section
pages.

To browse Content, select Content in the Browse drop-down list and click GO. A list of
all content appears. Click the headline to preview content or the ID to view previous
versions of the content. You can also click the dynamic URL or the static URL (if content
has been published) of the content to preview the content. Click Edit to change content
or modify its status. If you can't find the content you are looking for in the Browse
window, you can use the Search feature to find it.

Content Versioning
Sparkplug includes a convenient, easy-to-use versioning function that allows you to roll
content back to a previous version. To use Content Versioning, select Content from the
Browse drop-down list and click on the content ID. This loads the Content Preview page.
Click the version that you would like to revert to and click the This Version button. The
content is then updated to revert to the relevant version.

Content Scheduling
Content Scheduling allows users with Publisher or Admin privileges to schedule content
with a status of ‘Edited’ to automatically appear on live dynamic sites at a certain time
on a specific date. To use content scheduling, click the Schedule button at the top of the
screen. Content with a status of ‘Edited’ can be scheduled using the content filter.

You can schedule multiple content items at a time. Enter a day and time that you want
the content to appear Live on your Web site. Sparkplug will generate an entry under
Scheduled Tasks in the Coldfusion Administrator interface. On the scheduled date and
time, the status of your content will be changed from ‘Edited’ to ‘Live’ and the content
will appear on your dynamic Web site automatically. The task will be automatically
removed from the Coldfusion Administrator once it is completed.

You can also use the Content Scheduling feature to bulk set imported RSS feeds to Live.
The RSS Feed import feature gives imported content a status of Edited. Content
Scheduling is a quick and convenient way to make the imported content go Live on the
site.

E-mailing Content
Sparkplug allows users to e-mail content from any e-mail client to a live dynamic site.
You do this by sending a correctly formatted message to a specific e-mail address. You
need to be able to set up a new e-mail account on your mail server to use this feature.
Steps are as follows -

   1   First, create a new e-mail account on your mail server called something like
       sparkplug@yourdomain.com
   2   Next, open the file in the _admin folder called MailContent.cfm
   3   Configure the two sections between the comment tags <!--- ALTER TO
       CONFIGURE MAILCONTENT -
   4   Finally, create a Schedule Task in the Coldfusion Administrator that will run the
       MailContent.cfm file every few minutes or at intervals that suit your
       requirements.
MailContent.cfm checks the specified mail server account according to your Scheduled
Task for new messages. If there is a new message in the correct format, the content of
the message will be added to the Content database.

Formatting Message
For E-mail to Sparkplug to work correctly, the e-mail message must be formatted
to exact rules. First, in the To: section of the e-mail type
sparkplug@yourdomain.com [replace yourdomain.com with the correct domain].
The subject of your e-mail message must have the following format:

SiteID,SectionID,Headline,Rank,User,Status. E.g. 1,6,SparkPlug is so cool
man,4,Default Admin,Live (no spaces before or after the commas).

You may replace the Live status with Edited or Added if you don’t want the content to
go Live immediately.

The entire body of the e-mail message will become the body of the content.
Getting the subject wrong will either result in MailContent.cfm doing nothing or
inserting rubbish in your content database so use this feature carefully.

NOTE: The E-mail To Sparkplug feature is as secure as the sparkplug@yourdomain.com e-mail
account so do not give out this e-mail account or the message formatting instructions to anyone
who might abuse it. MailContent.cfm processes messages on the e-mail server one at a time. If you
send many content messages to the server, be sure to set the MailContent.cfm Schedule Task to
run quite frequently.

It is recommended that in its current form, this feature should be used sparingly as
running the MailContent.cfm file very frequently may take up valuable system
resources.
PUBLISHING YOUR WEB SITE

In Sparkplug, publishing your Web site means instead of serving dynamic Web pages
such as content.cfm?id=1 or section.cfm?id=2, you serve static HTML versions of these
pages such as news.html or bush_wins_florida.html. Sparkplug provides a useful
Publish feature that allows you to create static versions of your Web sites that you can
serve from any Web server – no Coldfusion required.

Sparkplug offers two publishing options: Publish to HTML Directory and Publish to
FTP Server. Publish to HTML Directory publishes static HTML pages of your site to the
html folder below your site folder. Publish to FTP Server copies the contents of your html
folder to a remote FTP server you specify in your site settings or on the Publish to FTP
Server screen. Only users with Publisher privileges can use the publish feature. On the
Publish screen you’ll also find two RSS Feed related features – Publish RSS 2.0 Feed
and Import RSS 2.0 Feeds. These are used to create RSS feeds of your site content and
to import RSS feeds into your site respectively.

Publish Section Pages
Sparkplug publishes Section Pages and Content Pages separately. Sometimes you
might want to publish a single content page without republishing the relevant
section/index page listing all content belonging to the same section. Also, because
users may create Sections that don’t necessarily feature on the site – e.g. a section
called Miscellaneous could be created to hold templates that you include in other
templates, in which case templates assigned to Miscellaneous would not need to be
published separately – only sections with a rank can be published. Therefore, you
determine which Section Templates are publishable by assigning a Rank (a number
from 1 to the number of ranked sections) to that Section.

Sparkplug uses a default naming convention for static HTML pages, based on the name
of the section or the content headline, that allows you to generate automatic lists and
menus that point to static HTML pages instead of dynamic pages.

The HTML file naming convention for published Sections is #section#.html. For Content
Pages (see following section) it is #headline#.html. Spaces are replaced with
underscores (_).

You can publish all ranked Sections or individual sections. You can preview published
Section Pages either using the publish result screen which lists all pages just published
or by browsing Sections and clicking on the static url or HTML file for that template.

Publish Content Pages
As mentioned in the previous section, published content templates are saved in your
site’s HTML directory in the format #headline#.html with spaces replaced by underscores (_).
You can rename these files as you like. You can select the content you wish to publish
using the Publish Content Filter on the previous screen. Only content with a status of
‘Live’ can be published.

You can preview published content pages either using the post publish screen which
lists all pages just published or by browsing or searching content and clicking on the
static url or HTML file for that content.

NOTE: Published section and content pages are all stored in the html folder for your site, complete
with relevant images, media files and documents.
Publish RSS 2.0 Feed
The Publish RSS 2.0 Feed option allows you to selectively publish site content to an RSS
2.0-compatible XML file called rss.xml that can be used to syndicate your content on
the Internet. You can publish selected content, all content belonging to a particular
section or all the content on your site. The file is published to a folder called rss either
in your site’s folder (dynamic sites) or in your site’s html folder (static) sites.

Before using the Publish RSS 2.0 Feed option, you should edit the admin template
called publishrssfeed.cfm in a text editor like Notepad to add your site details to the
RSS feed or change the name of the published rss.xml file if you so wish.

Only the following fields should be modified:

<title>My Site Title</title> [The name or title of your site]
<link>http://www.mysite.com</link> [The URL of your site]
<description>My Site Description</description> [A description of what your site is about]
<language>en-us</language> [Optional, change if your site is not in English]
<copyright>copyright (c) #DateFormat(now(), "yyyy")# My Site Name</copyright> [Copyright owner]
<docs>http://www.mysite.com/rssfolder/</docs> [The URL location of your RSS feed]

To change the default filename of the feed from rss.xml, edit all references to rss.xml
in publishrssfeed.cfm.

Import RSS 2.0 Feeds
You can import RSS Feeds and use them as site content. In the Publish window, click Import RSS
Feeds as Site Content. Enter a name for the Feed and a Feed URL and select a Site Section that
the feed will be imported into. Click the Add Feed button. The saved feed will appear at the bottom
of the window. You can then click the Import Feed button to select which feed items you would like
to import. Imported feeds are assigned a status of Edited. You can click the Schedule tab to view
the imported feeds and schedule them to go Live if you wish or you can Browse content and
individually change the status of the imported feeds.


Publish To FTP Server
Publish to FTP Server copies the entire html folder (containing static HTML files) for your
site to a remote FTP server you specify either when you create the site or on the Publish
to FTP Server screen. To make sure that you are copying the most recent static HTML
version of your site be sure to publish Content and Section Templates before using
Publish to FTP Server.

To access the Publish to FTP Server page, click the Publish button at the top of the
Sparkplug screen and then click Publish to FTP Server. If you haven’t done so already,
enter details for your remote FTP server and click the Save button. Next, click the
connect button. If your FTP details are valid, you will be connected to your FTP server.
The Publish to FTP Server tool is not meant to replace FTP software, it merely offers a
convenient way to copy your static HTML Sparkplug site to a remote server directory
you specify. You cannot change remote directories once connected. Also, not all FTP
servers will allow you to connect with the tool as access is dependent on your server
settings.

NOTE: You can select multiple files to send to the FTP server by pressing CTRL and selecting the
relevant files.

GOING LIVE
Once you’ve added Sections, images and content and published (for static sites) your
pages, you are ready to take the site Live. Going Live simply means using your Web
server software to point a domain or IP address into the folder of a specific Sparkplug
site. Exactly which page you want to use as your site’s entry point is up to you and
depends on whether your site is dynamic or static or whether you want to have a long
URL or a short URL. In general we recommend that your Web server be setup so that
your domain or IP is pointing to either your site folder (dynamic sites) or your site’s html
folder (static sites). That way your Web site can be located using either
http://www.yoursite.com/index.html (static) or http://www.yoursite.com/section.cfm?id=1
(dynamic) or simply http://www.yoursite.com if you have set up either index.html or
section.cfm?id=1 as your default document.
I. APPENDIX: INTRODUCTION FOR DEVELOPERS

This section is aimed at Web developers with some Coldfusion experience. At the very
least, developers should be familiar with writing SQL queries using <CFQUERY> and
outputting the results of those queries using <CFOUTPUT>. The following sections are
aimed at developers who wish to perform any of the following tasks:

   1   Customize or add functionality to the Sparkplug CMS
   2   Bypass the standard GetContent query and write their own SQL queries
   3   Gain a better understanding of the architecture of the Sparkplug CMS

Sparkplug is essentially composed of Coldfusion data input templates located in the
_admin folder under the main sparkplug folder. These templates may be linked to each
other or independent of each other. The one thing they all have in common is that they
retrieve or add data from or to the SparkPlug.mdb database, located in the database
folder using SQL queries encapsulated in Coldfusion <CFQUERY> tags and
<CFOUTPUT> tags for data output. That’s all there is to the architecture of Sparkplug.
The knowledge or intellectual property, such that there is, in the product is in the way
these templates interact with each other and with the SparkPlug.mdb database. If you
can write SQL queries, CFML code and HTML, you can customize the Sparkplug CMS.

The following appendix takes a look at the key Sparkplug database tables, their
relationships with each other and how you can use <CFQUERY> and
<CFOUTPUT> tags to make your templates do exactly what you want.
II. APPENDIX: DATABASE TABLES & QUERIES

You can open the sparkplug.mdb database in Access to take a look at the tables and
their relationships with each other.

One advantage of a database-driven CMS with a flexible templating system like
Sparkplug, is that the application does not restrict how content is displayed. For
example, developers can output data in any of the fields in the Content table anywhere
in their templates.

The Built-in GetContent Query
For the benefit of users who have little or no Coldfusion or SQL knowledge,
Sparkplug has a built-in query called GetContent which is used by the section.cfm and
content.cfm files that deliver dynamic pages to the end user or retrieve content for
publishing. All the user has to do is output the results of the GetContent query in their
section or content templates using the <CFOUTPUT> tag. The code that outputs the
result of the GetContent query can be found by editing Sections and looking in the
Index Code and Page Code form fields.

The GetContent query basically returns all the fields you’d need in a section or content
template. In a section template you’ll get all the fields needed to list content headline,
author, image, abstract, date added, linktext and so on and in a content template you
basically get all the attributes of the content including the content headline, body and
so on. You output these content attributes by using <CFOUTPUT> to output variables
returned by the query such as #headline#, #DateAdded#, #abstract# and so on.

GetContent in Section Templates
The <CFOUTPUT> code found in the Index Code field of the Edit Section input form is
based on a section or index page for a news portal. It loops through all content assigned
to a particular section outputting the following content variables: #headline# (linked to
the content page), #dateadded#, #author#, #image# (if any), #abstract# and
#linktext# (also linked to the content page). Example code is shown below:
<CFLOOP QUERY=GetContent STARTROW=1 ENDROW=#GetContent.RecordCount#>
<CFOUTPUT>
<p><b><a href=content.cfm?id=#contentid# target=_self>#headline#</a></b><br>
<p>Posted on: <i>#DateFormat(DateAdded, "DDDD DD, MMMM YYYY")#<br> By:
#author#</i></p>
<p><cfif GetContent.Image IS "NONE">
<cfelse><img src=images/#image# align=left></cfif>
<p>#ParagraphFormat(abstract)#</p> <p><i><a href=content.cfm?id=#contentid#
target=_self>#LinkText#</a></i></p>
</CFOUTPUT>
</CFLOOP>

If there are 5 content items assigned to this section with a status of Live, then the
section template will output the headline, date, author, image, abstract and link text for
each one. The headline and link text are linked to content.cfm or published content
pages, which will load the content item that corresponds to id=#contented# or to
pubishedfilename.html.

Not all Web sites require the date, author, abstract, image or link text of content to be
published on section pages. Developers can easily modify the code in Edit Sections to
return only the headline and date or only a headline and an abstract. The modified code
may look something like this:
<CFLOOP QUERY=GetContent STARTROW=1 ENDROW=#GetContent.RecordCount#>
<CFOUTPUT>
<p><b><a href=content.cfm?id=#contentid# target=_self>#headline#</a></b>
<i>#DateFormat(DateAdded, "DDDD DD, MMMM YYYY")#</p>
</CFOUTPUT>

</CFLOOP>

GetContent in Content Templates
The <CFOUTPUT> code found in the Page Code field of the Edit Section input form is
based on a content page for a news portal. It outputs key fields of data from the
Content table in the database for a single content based on the content id. The default
code looks something like this:
<CFOUTPUT QUERY="GetContent">
<p><b>#headline#</b><br>
Posted by: <i>#Author#</i><br>
Date: #DateFormat(DateAdded, "DDDD DD, MMMM YYYY")#</p>
<p>#abstract#</p>
<p><cfif GetContent.Image IS "NONE">
<cfelse>
<img src="images/#image#" align="left">
</cfif>
#ParagraphFormat(body)#</p>
</CFOUTPUT>

The code outputs the headline, author, date added, abstract, image (if any) and body
of the current content item. Many corporate sites for example may not want to output
the author or date of the content, preferring a simple title/headline and the body of the
content. In this case, the code above can be modified to become:
<CFOUTPUT QUERY="GetContent">
<p><b>#headline#</b></p>
<p>#ParagraphFormat(body)#</p>
</CFOUTPUT>


As you can see by looking at the Content table in Access, the following content fields in
the database are available for outputting in your site pages by simply outputting the
GetContent query:

Content Table Content Variables:

#headline#
#dateadded#
#author#
#email#
#abstract#
#image#
#body#
#linktext#
NOTE: Fields not listed above are used internally by Sparkplug and are generally not used explicitly in site
templates.

Writing Your Own Queries
In general, there is no reason to bypass the GetContent query as its results can be
modified to suit the requirements of most Web sites – from corporate Web sites to
portals. However, one of the advantages of Sparkplug and the Coldfusion platform is
that you can easily write your own queries which don’t necessary follow any preset
rules. The following scenarios require you to either bypass GetContent or to write other
queries in addition to GetContent.

Scenario 1
You have a section called Sports. You want the Sports section template to list only ‘Live’
content with a rank from 1 to 10. Developer writes own query by Editing the Index Code
field in the Sports section and outputs that query instead of the GetContent query. The
query might look something like this:

<CFQUERY NAME="Get1To10" DATASOURCE="NAME_OF_DATASOURCE">
SELECT ContentID, Headline FROM Content WHERE Rank > 0 AND Rank < 11 AND Sectionsid =
SECTION_ID_OF_CURRENT_SECTION AND Status = ‘Live’ ORDER BY Rank ASC
</cfquery>
<CFOUTPUT QUERY=”Get1To10”>
<a href=”content.cfm?id=#contentid#”>#headline#</a><br>
</CFOUTPUT>

The above query checks the content table for all ‘Live’ Content belonging to a section
with a particular sectionid with a rank greater than zero and less than eleven. The
results are ordered by rank, content with a rank of 1 coming first and so on. This query
is then output using <CFOUTPUT query=”Get1to10”> instead of <CFOUTPUT
query=”GetContent”>. You’ve just bypassed the default GetContent query.

Scenario 2
You have a section called Sports but you also want to output ‘Live’ content belonging to
another section called Entertainment on the same page.

Developer writes own query at the beginning of the Index Code field of the Sports
section and outputs that query in addition to the GetContent query. The query might
look something like this:

<CFQUERY NAME="GetEntertainment" DATASOURCE="NAME_OF_DATASOURCE">
SELECT ContentID, Headline FROM Content WHERE Sectionsid =
SECTION_ID_OF_ENTERTAINMENT_SECTION AND Status = ‘Live’ ORDER BY Rank ASC
</cfquery>

The above query checks the content table for all ‘Live’ Content belonging to the
Entertainment section. The results are ordered by rank, content with a rank of coming
first and so on. This query is then output anywhere in the Sports Template using
<CFOUTPUT> along with GetContent.

<CFOUTPUT QUERY=”GetContent”>
<a href=”content.cfm?id=#contentid#”>#headline#</a><br>
</CFOUTPUT>
<CFOUTPUT QUERY=”GetEntertainment”>
<a href=”content.cfm?id=#contentid#”>#headline#</a><br>
</CFOUTPUT>




Scenario 3
You want your Sports content pages to show the current content as well as links to
other ‘Live’ content assigned to the Sports section.

Developer writes own query at the beginning of the Page Code field of the Sports
section and outputs that query in addition to the GetContent query.

The query for other ‘Live’ content might look something like this:

<CFQUERY NAME="GetOtherContent" DATASOURCE="NAME_OF_DATASOURCE">
SELECT ContentID, Headline FROM Content
WHERE SectionsID=#GetContent.SectionsID# AND ContentID<>#Url.ID# AND Status=’Live’ ORDER BY
Rank ASC
</cfquery>

The above query checks the content table for all ‘Live’ Content belonging to the same
section as the current content page (in this case Sports) and having a different
contented from the current content. This is the same as saying all other content
belonging to this section. The results are ordered by rank, content with a rank of 1
coming first and so on. This query is then output somewhere in the Sports content
template along with GetContent using <CFOUTPUT>.
<p>
<b>Also in Sports:</b><br>
<CFOUTPUT QUERY=”GetOtherContent”>
<a href=”content.cfm?id=#contentid#”>#headline#</a><br>
</CFOUTPUT>
</p>

TIP: To see what the GetContent query looks like open up content.cfm or section.cfm
located in your site directory in notepad.
III APPENDIX: TIPS AND TRICKS

The Demo Site
Sparkplug includes with a Demo Site that refer to for ideas on how to set up your own
Web sites. The Demo Site is simple yet it demonstrates that Sparkplug offers the
flexibility for Web developers to architect any kind of site – from news portals to
corporate Web sites. The Demo Site will help developers understand many of the
features of Sparkplug much more quickly but it by no means uses all the capabilities of
Sparkplug.

Log in to the Demo Site and experiment with the content, images etc. The Demo Site
has several sections: Main (for the site’s front page and content pages), Bookshop (for
a simple online store, Useful Links, and Posters (a simple image gallery). Two extra
sections Navigation Bar and Navigation Footer do not have a Rank, because they will be
used to hold code that will be included in the other sections mentioned above using
<cfinclude> statements.

Notice that when you edit these two sections, there is no dynamic code in the Index
Code and Page Code fields. That’s because these Sections will not display content from
the Sparkplug database. Unranked Sections can be used to hold banner ads, Google
Adsense code etc. which can be included in other Sections. The code to be included can
be inserted in either the Header or Footer fields but never in the Index Code or Page
Code fields in an unranked Section. Of course Sections with a Rank can also be included
in other Sections, allowing you to populate for example the Main section with books
from the Bookshop.

Shared Template Components
Coldfusion includes a very useful tag called <CFINCLUDE> that developers can use to
share components such as footers, headers, menus, banner ads, stylesheets, login
boxes, search fields and even content lists across different templates. The advantage of
sharing components is simple: if you change a menu for example, all templates sharing
this component will automatically inherit the new changes. If your site has 50
templates, the advantage of sharing components does not need to be explained to see
the benefits. You apply changes once instead of 50 times.

All Sparkplug generated pages are Coldfusion-enabled allowing you to use
<CFINCLUDE> to share components across your site pages.

Shared Menu:
It is good practice to create a Section in Sparkplug to hold your shared components.
Call this Section something like Shared or Includes. This Section should not be ranked
and should not have content assigned to it. Create a Section in Sparkplug, which you
plan to use as a menu. Call it something descriptive like
Menu. Do not enter a header or footer for this section. Copy and paste the HTML code
for your menu (can be just text links, image buttons or even a Java applet) into the
Index_Code form field, modify the links and save it.

Select Section in the Browse drop-down list to list all your Sections. Click Edit for the
Section you want to add the menu to. At the location you want to add the menu add the
following code:

<CFINCLUDE Template="yourmenufile.cfm">
* Change yourmenufile.cfm to the .cfm filename of your menu section.

Save the Section and preview it in Browse mode by clicking on its dynamic url.
You'll see that your menu now appears on the Section page. Repeat the same steps for
all Sections that will use the menu. In the future, when you edit the menu Section, all
templates that use the menu file will automatically reflect the changes.

Shared Banner Ads:
The procedure is the same as for shared menus. Create a Section with the banner ad
code inserted. Do not rank it. Give it a descriptive name such as Banners and use the
<CFINCLUDE> code above to insert the Section into any of your other Sections that
need to display the banner. You can do the same with external code such as Amazon
products, stock quotes, polls, third party content and so on.

TIP: When you develop Section templates in your HTML editor for addition to Sparkplug,
it is good practice to design them in such a way (e.g. using tables or <div>s) that they
can be easily separated into components such as Header, Footer, Left, Right, Submenu
and so on. Add these components to Sparkplug as shared components and assemble
your Section templates in Sparkplug using multiple <CFINCLUDES>. This will allow you
to share code snippets across your entire site.


Implementing Sub-sections
Sparkplug does not explicitly support site subsections. It doesn’t need to. Instead
developers can use the section rank field and <CFINCLUDE> to create sites with
complex subsections.

Let's dive right into an example. Imagine an Internet portal with the following sections
and subsections:

Section: Entertainment:
Subsections: Music, Film, Art
Section: Finance:
Subsections: Stocks, Bonds, Futures
Section: Sports:
Subsections: Football, Tennis, Golf


Music, Film, Art are subsections of a section called Entertainment. Stocks, Bonds,
Futures are subsections of a section called Finance. Finally Football, Tennis and
Golf are subsections of a section called Sports.

To start with, we create all twelve subsections and sections as ordinary sections in
Sparkplug. We then give each section a rank. Ranks are shown here in brackets.

Section: Entertainment(1)
Subsections: Music(2), Film(3), Art(4)
Section: Finance(11):
Subsections: Stocks(12), Bonds(13), Futures(14)
Section: Sports(21):
Subsections: Football(22), Tennis(23), Golf(24)

The numbers in brackets are the section ranks. The rank will determine which order the
sections appear in the site tree. Why do we jump from 4 to 11 and from
14 to 21? Because we are leaving some ranking slots for future subsections. We might
want to add Fashion and Dance to Entertainment in the future or Options and
Commodities to Finance in the future.
If these Sections and Subsections are identical then you just cut and paste the Header
and Footer HTML code into the New Section forms or include existing Sections or
Section Headers using a <cfinclude>.

To implement subsections at the site level, edit the Entertainment section. We want it
to display content headlines for generic Entertainment stories as well as headlines for
subsections Music, Film and Art. Instead of outputting the default <GetContent> query
provided in the New Section Template form which will only output content added to the
Entertainment section, we can write our own SQL queries in a CFQUERY tag such as:

Entertainment:
<CFQUERY NAME="GetEntArticles" DATASOURCE="YOUR DATASOURCE" MAXROWS="5">
SELECT Headline, ContentID FROM Content WHERE SectionssID = '1' AND Status = 'Live' ORDER BY
Rank ASC
</CFQUERY>
<CFOUTPUT QUERY="GetEntArticles">
<a href="content.cfm?id=#contentid#">#headline#</a>
</CFOUTPUT>

Music:
<CFQUERY NAME="GetMusicArticles" DATASOURCE="YOUR DATASOURCE" MAXROWS="5">
SELECT Headline, ContentID FROM Content WHERE SectionssID = '2' AND Status = 'Live' ORDER BY
Rank ASC
</CFQUERY>
<CFOUTPUT QUERY="GetMusicArticles">
<a href="content.cfm?id=#contentid#">#headline#</a>
</CFOUTPUT>

Film:
<CFQUERY NAME="GetFilmArticles" DATASOURCE="YOUR DATASOURCE" MAXROWS="5">
SELECT Headline, ContentID FROM Content WHERE SectionssID = '3' AND Status = 'Live' ORDER BY
Rank ASC
</CFQUERY>
<CFOUTPUT QUERY="GetFilmArticles">
<a href="content.cfm?id=#contentid#">#headline#</a>
</CFOUTPUT>

Art:
<CFQUERY NAME="GetArtArticles" DATASOURCE="YOUR DATASOURCE" MAXROWS="5">
SELECT Headline, ContentID FROM Content WHERE SectionssID = '4' AND Status = 'Live' ORDER BY
Rank ASC
</CFQUERY>
<CFOUTPUT QUERY="GetArtArticles">
<a href="content.cfm?id=#contentid#">#headline#</a>
</CFOUTPUT>

Repeat the above <CFQUERY> and <CFOUTPUT> code for all the subsections related
to each section. When you are done, add content to the various sections and
subsections, set the status of the content to Live and preview the Entertainment
section (the dynamic url will be something like section.cfm?id=1). The section page
should list content like this:


Entertainment:
Napster clone sued again
RIAA intensifies fight against piracy
China passes new entertainment law
What's in a song name?
Wushu the next big thing

Music:
Michael Jackson calls it quits
Madonna to marry again
Britney becomes a nun
N'Sync split up
Barry White loses voice

... and so on.

Finally, we want the Entertainment section and related subsections to let the user know
where they are on the site. We want a dynamic navigation bar. Create an Section called
something like EntNavBar and do not give it a Rank. Write a query in the Index Code
field for the Entertainment section and related subsections.

<CFQUERY NAME="GetNavBar" DATASOURCE="YOUR DATASOURCE" MAXROWS="10">
SELECT SectionsID, Sections FROM Sections
WHERE SiteID='ID_OF_SITE' AND Rank LTE 10 ORDER BY Rank ASC
</CFQUERY>

Note: Above query is for illustration purposes only. The query picks up all Sections with a rank of 10
or less. i.e. all Entertainment sections and subsections. We order query results by Rank ascending
because we want the first query result to be the section and we want to determine the order of
related subsections.

In the Index_Code field of the EntNavBar section we output the GetNavBar query using
a <CFLOOP> like so:
<CFLOOP QUERY="GetNavBar" STARTROW="1" ENDROW="#GetNavBar.RecordCount#">
<b><cfif SectionsID = '#url.id#>#Sections#<cfelse><a
href="sections.cfm?id=#sectionsid#">#Sections#</a></cfif> ></b>
</cfif>
</CFLOOP>

Save the EntNavBar section.

Now, use the <CFINCLUDE> tag to ensure that all Entertainment sections and
subsections call the EntNavBar.cfm section. For each Section add the following code
where you want the navbar to appear.

<cfinclude template="GetNavBar.cfm">

All things being equal, the following navigation bar should appear in your
Entertainment section and subsection templates:

Entertainment: > Music > Film > Art >

The CFIF statement in the code ensures that the name of the current section or
subsection will not be linked but the others will be linked to their respective Section
pages. The query on the Music Section Templates should list only music articles and the
query on the Film Section Templates should list only Film articles. Using the default
Coldfusion code for these Sections is fine unless you want them to do something other
than list all related Live content.
NOTE: How automated your templates become depend entirely on how you write your queries.
Queries that loop over sections ranked from 1 to 10 for example will automatically output future
subsections related to that section - up to 10. If you think more subsections will be added in the
future, feel free to use a higher number of ranks for each family of sections and subsections.

Remember also that the process described above will only have to be done once at the site
development stage. Afterwards, content contributors can simply add content and assign it to the
correct section or subsection. Site editors approve the content and give it a rank and the dynamic
code takes care of the rest.


Building Single-Section Sites
Developers can build complex portals in Sparkplug that use multiple sections. They can
also build corporate Web sites using only a single section. This is probably the quickest
route to getting a dynamic database-driven site up and running in Sparkplug. The
following explains how to build a site using a single section.

Absolutely the first thing anyone building a new Web site in Sparkplug should do is not
go into Sparkplug’s admin interface at all. Go to your favourite Web site creation
software - Dreamweaver, FrontPage, whatever - and create a template
(HTML page) that determines the look and feel for your new site. This is a single
HTML file that will determine how your Web site is going to look. Leave a blank
space in the template to hold dynamic content from the database.

When designing the template bear in mind where Sparkplug stores images, documents
and media used by your Section and Content pages. Relative and absolute URLs to
those files should be as follows:

/images/filename.gif
/docs/filename.pdf
/media/filename.swf

OR

http://www.mysite.com/images/filename.gif
http://www.mysite.com/docs/filename.pdf
http://www.mysite.com/media/filename.swf


So make sure, when you are using Dreamweaver or whatever to use the right relative
or absolute paths to images and so on such as <img src=”images/pic.gif”> or <a
href=”docs/price.pdf”>Price List</a>.

If your HTML template is complex it might be an idea to put placeholders in the
template where dynamic content will appear. E.g. you might put placeholders such as
[Title Here] or [Author Name Here] or [Content Body Here]. Once you are happy with
your HTML template, it's time to add it to Sparkplug.

Log into the site that will use the template you just created. Every Sparkplug site
should have at least one section. For our single-template site, one section is all we need.
So, go ahead and create a section called "Main". Select Section in the
New drop-down and click Go. Now we have a section, we need to decide what it is going
to look like. In other words, we need to assign a Header and Footer to it.

Add a new section by selecting Section in the New drop-down list and clicking Go. In the
resulting page, give your Section a single-word name and paste the header and footer
HTML code of the template you designed in Dreamweaver, or whatever, into the
Header and Footer fields.

You now have a single Section with an HTML header and footer. There are a couple of
things wrong with the section though. The images, Flash files etc. referenced in it have
not yet been uploaded to Sparkplug. Secondly we have not yet modified the dynamic
code that will output the content for the section.

Upload all the images and media files called by the template by selecting Images or
Media in the Upload drop-down list and clicking Go.

Next, edit the newly created Section. You will find that Sparkplug has created dynamic
code (Index Code and Page Code) that handles how index pages and content pages for
this section will behave. You can modify the code in both these fields by adding HTML
formatting or outputting additional or fewer variables. The available variables are as
follows -

#headline# (the title of the content)
#sectionid# (the id of the section content belongs to)
#author# (who added the content)
#dateadded# (the date content was added)
#abstract# (a brief summary or intro to content)
#body# (the main body of the content)
#image# (a content image associated with the content)
#linktext# (the text prompting the reader to continue or read on. usually used by news sites)

You might also want your pages to generate the contents of your title and meta tags
dynamically so that each page in your site has a different title at the top of the browser.
Do it like so:
<title>
<!-- Dynamic Title -->
<CFOUTPUT>
<p>#getcontent.headline#</p>
</CFOUTPUT>
<!-- Dynamic Title -->
</title>

Once you are done editing the Section, your site customization is complete. The only
thing left to do is to add content to Sparkplug and assign it to that Section. Adding
content is easy since we only have one section anyway. Select Content in the New
drop-down and click Go. On the resulting input form enter a title for the content in the
Headline field, an abstract if you need one, the body of the content etc. Then click Add
Content.

Sparkplug has a staged approach to content. This is largely because in most corporate
environments the people adding content are not necessarily the same people editing or
approving it. The three stages are Added, Edited and Live. Anyway, all content in
Sparkplug is assigned to someone when it is first added by selecting that someone
(usually someone with Editor privileges) in the Assign To drop-down. Go ahead and
assign the content to yourself and click the Add Content button.

The content's status is now Added or Edited or Live, depending on your selection. If you
assigned the content to yourself and the Status was not set to Live, you can then click
on My Workspace. You'll see the content sitting there, waiting for you to send it off to
the next stage. Click Edit. You need to do two things to be done with the content. First
thing is give it a rank or a number which determines its order of importance in the
Section it belongs to. Second thing is set its status to ‘Live’. Rank content with numbers
starting from 1 and going up incrementally.

Once you have added content and gone through the steps above, refresh the site tree.
You'll now see our single section called Main. Click the plus sign next to the Main section
to expand it. You'll see the headline(s) of the content we just added. Click a headline to
preview the Live content. If you did everything correctly the content should appear in
all its glory in the template we added earlier.

Add more content by assigning it to yourself, then giving it a rank then changing its
status to Live or by set it to Live immediately. So for a 5 page corporate Web site we
may have content looking something like this:

Headline Dynamic URL Static URL (if published) Rank
About | content.cfm?id=1 | about.html | 1
Products | content.cfm?id=2 | products.html | 2
Services | content.cfm?id=3 | services.html | 3
Support | content.cfm?id=4 | support.html | 4
Contact | content.cfm?id=5 | contact.html | 5

OK, so now we have a section called Main, and 5 content pages. Now we need a menu.
We can add a tree applet, text links or roll-over buttons to the Main section Header and
just link them to each specific content page. So our About menu button or link will link
to content.cfm?id=1 (if our site will be dynamic) or about.html (if our site will be static)
and so on.

If your site will be static HTML files, click the Publish button and publish the 5 content
pages. HTML versions of your pages will be generated using your header and footer
code for the section. Static HTML files and related images etc. are all stored in the /html
folder below your site. You can point your Web server to this directory if you do your
own hosting or just FTP the entire /html folder to your ISP.

Now, imagine if this was not a 5 page site but a 500 page site. Instead of creating
500 pages in Dreamweaver you will create just 1 single HTML template in Sparkplug.
You will then add 500 content pieces to the database without worrying about their
appearance or formatting. Then by hitting the Publish button you generate 500
picture-perfect HTML pages all based on your single Main section. Sparkplug makes
creating corporate Web sites that easy.


Creating Automatic Menus
In the previous example, we built a single-section site and added a menu with links
added manually. What if we wanted to generate an automatic menu that expands or
contracts automatically when content is deleted or added? This menu could be
composed of text links, tree applets, image buttons etc. The following two types of
menus are possible:

   1   Menu populated with content headlines
   2   Menu populated with section names

Menu populated with content headlines
This is the easiest dynamic menu to generate. Imagine a single-section site as
described in the previous section. Content headlines are as follows: About,
Products, Services, Support, Contact. First we write a <CFQUERY> that returns all content
for this site that is Live and has a rank.

<CFQUERY NAME=”GetMenuItems” DATASOURCE=”YOUR_DATASOURCE”>
SELECT ContentID, Headline from Content WHERE SectionsID=”ID_OF_YOUR_SINGLE_SECTION” AND
Status = ‘Live’ AND Rank IS NOT NULL ORDER BY Rank ASC
</CFQUERY>

In the location in the template where your menu will go, output the results of the query
using <CFOUTPUT>

<table>
<CFOUTPUT QUERY=”GetMenuItems”>
<tr><td><a href=”content.cfm?id=#contentid#”>#headline#</a></td></tr>
</CFOUTPUT>
</table>

OR

<table>
<CFOUTPUT QUERY=”GetMenuItems”>
<tr><td><a href=”#htmlfile#”>#headline#</a></td></tr>
</CFOUTPUT>
</table>


To output a button menu, you name your images after the content titles. E.g. About.gif,
Products.gif, Services.gif, Support.gif, Contact.gif or even better, after the Content IDs. E.g.
1.gif, 2.gif, 3.gif, 4.gif, 5.gif Use the following code to output the images dynamically:

<table>
<CFOUTPUT QUERY=”GetMenuItems”>
<tr><td><a href=”content.cfm?id=#contentid#”><img
src=”images/#contentid#.gif”></a></td></tr>
</CFOUTPUT>
</table>


Menu populated with section names
To create a menu populated with section names, you should rank the sections that you
want to appear in the menu. Then write a query that retrieves the
Section IDs of each section.

<CFQUERY NAME=”GetMenuItems” DATASOURCE=”YOUR_DATASOURCE”>
SELECT Sections, SectionsID from Sections WHERE
SiteID=’ID_OF_CURRENT_SITE’ AND Rank IS NOT NULL ORDER BY Rank ASC
</CFQUERY>

In the location in the Section header or footer where your menu will go, output the
results of the query using <CFOUTPUT>

<table>
<CFOUTPUT QUERY=”GetMenuItems”>
<tr><td><a href=”section.cfm?id=#sectionsid#”>#Sections#</a></td></tr>
</CFOUTPUT>
</table>

To output a button menu, you name your images after the Section names or Section
IDs. E.g. About.gif, Products.gif, Services.gif, Support.gif, Contact.gif or 1.gif, 2.gif, 3.gif, 4.gif,
5.gif. Use the following code to output the menu images:
<table>
<CFOUTPUT QUERY=”GetMenuItems”>
<tr><td><a href=”section.cfm?id=#sectionsid#”><img
src=”#SectionsID#.gif”></a></td></tr>
</CFOUTPUT>
</table>

NOTE: Code used throughout this documentation is for illustration purposes only. There is no
guarantee that the code will work in your particular Sparkplug setup. Developers will have to modify
the code according to their specific Sparkplug installation and site information.



                                          -- THE END --

								
To top