First of all, see the accompanying diagram to see how this works:here.

What is web instances? Well imagine if library items could have their own templates, and that the data that get's filled in the template was in a spreadsheet like page you could edit? That is what web instances is.

You can now insert reusable objects into your pages, anywhere in the site, and the data behind each element can be changed, or the html wrapping that data can be changed and when you hit GO all pages can be updated!

How does it work? It's almost exactly like Web Merge - so read those docs too.

Create a data file html page consisting of a single table.
The first row defines the tagnames which will in turn correspond to tagnames in the prototype file.
The rows after that consist of the html code that will be inserted for each tagname in the prototype file.
There are two required columns: wiclass and wiprotourl.

wiclass is the classname or unique name for each set of data.
wiprotourl is the URL to the specific template for that set of data (you could cut and past the same data twice into another row, and now you can have two views of the same data! - just make sure the wiclass name is different)

Then create a tempate file that is the HTML "wrapper" code which looks quite like what you want to insert in your regular pages, except that you have placeholders for the data fields.

Next, go into your regular html pages, and insert this tag:

<webinstance class="foo"></webinstance>

foo is the name of the row of data, and is defined in the wiclass column.

Finally, run the Web Instances command and it will scour your site for webinstance tags, replace them with templates specific to each classname and instert in that template the correct data for the areas in that template that you defined.

Sound confusing?

Try to imagine that the proto html pages are library items. Imagine that the special tags you insert in them are XML tags like templates. Imagine that the data page is the XML source that gets "merged" into that template. Imagine that each row matches a specific library item.

The included example consists of:

demo_wi_data.html - the master data page.
demo_proto1.htlm - one prototype page
demo_proto2.html - another prototype page for the same data (another "view" of the data)
demo_page1.html - a regular website page with <webinstance> tags.
demo_one.html - second level page with the same "data" just a different view.
demo_two.html - second level page with the same "data" just a different view.

Create a site with the above files, install web instances, then try modifying the demo_proto1.html
Then run the command (to do this close all pages in the site and open a new blank page, so you can access the commands menu).
Choose demo_wi_data.html as the DATA URL.
Hit go. (You MUST have DWfile installed)

 

 

 

See the included example for help. If you have any questions email me. Andrew Wooldridge (andreww@netscape.com)