whump dot com

Suite:linkManager

This is a Fat Page

Experimental Software: This suite is under development and should be used at your own risk.

Managing Information in Categories

Many sites use the list of links as a way to organize information. Frontier's outliner format is an intuitive way to store this sort of information. I wanted a way I could group links by topic and render those groups where I want them. I wrote link manager to do this.

Installing

Grab the data from this Fat Page. Install it Frontier, go to suites.linkManager and run the Init script. The Init script will create a subtable in your user tree, linkManager, where it keeps test data and four 'parameters'.

Using

In your website's table, create a new subtable. I call mine #links, but you can use another name -- just remember it.

The subtable should have this structure:

#links
	category
		about
			description
			name
		items
			item #1
				description
				name
				url
			item #2
				description
				name
				url

See the table #example in user.linkManager for structure.

To render this table, use the macro call:

{suites.linkManager.renderTable(websites.yourSiteName.["#links"].category)}

Cooperating with the Glossary

renderTable looks for items with the same value of name in user.html.glossary and uses the glossary link associated with values it finds.

Customizing

There are four parameters you can use to customize the output of renderTable(). They can be found in the user.linkManager table.

categoryStart

HTML code to go before a category is rendered. The default value is nil.

categoryEnd

HTML code to go at the end of a category. The default is nil.

itemSep

HTML code to go between each item. The default is nil.

linkTemplate

The HTML used to render the link name, title and URL. The default is:

<h3><a href="#URL#">#NAME#</a></h3>
<p>#DESCRIPTION#</p>

You can use whatever you want, however, use #URL#, #NAME#, and #DESCRIPTION# because the renderer looks for those to replace with the values from the item it is rendering.

I use style sheets to control presentation on my site, but there should be sufficient hooks for people who want to use tables for formatting.

The XML Way

Rough

After writing the first version of this suite, I realized that XML is the right way to do this. However, I used the Frontier 5.1 version of the XML verbs.

Differences

The structure of the table is different. Write it as an XML document. Use xml.compile() and xml.decompile on the #siteRef table in user.linkManager.test to get a feel for the 'DTD' I'm using.

I used Microsoft's XML Notepad to generate the XML.

To render, the verb is suites.linkManager.renderXML(adrTable).

Comments and Bug Reports

Both are welcome. My plan is to concentrate on the XML version.


Last modified on 2/5/99; 6:44:21 PM.
Contact WHUMP dot COM.
Copyright © 1995-2000, Bill Humphries