Email:   
Home
In This Issue
EasyPrint
Click here for the RSS feed's XML code. This is not a browser URL.
PROGRAMMING POWER
Great scripts for discussion forums
By Kevin Hoffman

I work for a large corporation with many talented individuals. Some of the most talented are in our "Corporate Development" group. They made a commitment to develop a new knowledge management system with a focus on employee contribution and participation. Best of all, they have a lot of money.

So, in addition to taking advantage of our Lotus Domino infrastructure I could take time to find unique solutions to their business needs that Domino's basic feature set didn't quite meet. This article describes some of the methods I employed to meet my clients requirements.

If you read through it carefully, you'll get a number of great ideas for scripting discussion forums.

Fun with JavaScripted frames
Many developers have already seen the JavaScript trick of using two frames to aid navigation around a view. If not, simply stated you create one frame with links which are actually JavaScript pointers to links in the second frame. The links in the second frame actually have the Domino-generated code to navigate to the next or previous set of documents. Unfortunately, this trick breaks down when you attempt to extend the concept to switch between collapsible and flat views, from view to document or when viewing documents.

Another approach is to create a context sensitive navigation frame. This is a frame with navigation links where the links change based on the content of the page being viewed in the main frame. You can do this with a simple line of JavaScript code written in the HTML of the document in the main frame:

<SCRIPT>
parent.frames[2].location.replace("/Idea.nsf/vHTML/DefaultNavigator?OpenDocument");
</SCRIPT>

This simple yet powerful code replaces your navigation frame with a page containing the appropriate JavaScript code for the document or view being browsed in the main frame. You can place this line of code in documents, forms, view templates, agent generated HTML--basically just about anywhere.

This solution is flexible enough to handle almost every navigational situation. For example, when the user navigates to the next document in a view but is already at the last document, the view itself is displayed. When the view is generated, the browser evaluates this line of code and replaces the navigation frame with the appropriate navigation document. When the user switches from a collapsible view to a flat view, the "Expand" and "Collapse" links disappear from the navigation frame. If the user is reading a document in a discussion area, he can create a response document by clicking a "Respond" link in the navigation frame. You can also change the navigation frame if a document is in read or edit mode. Simply have two lines of the code, pointing to different pages, and use the appropriate hide when configuration.





[ Next ]

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Now for the first time, real-time dashboards within Notes!
No more tedious report iteration and endless data exporting! The New IntelliPRINT Dashboard Reporting now empowers you to easily create analyzable widgets and real-time dashboard reports. Your business managers can then quickly customize, extend, and analyze these dashboards to their heart's content!

All from within your Lotus Notes data, all in real-time!

Download your Free Trial today!

Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.
Editor's Login