« Small bugfix: Added working default value for Code Snippit | Main| Enhancement: Added the possibility to have a sideblock tied to certain permalink ids »

Enhancement: Code Snippits using LotusScript can now access all fields in Blog Configuration

Tags: Bug Fix Side block Enhancement

The existing code only exposed a single string as the interface between a LotusScript Code Snippit and the rendering core, namely the CodeBlockReturn string.

However, often code snippits may need information about the blog itself, especially stuff like the home URL, it's name and so on. This enhancement exposes all items in the configDoc to the Execute-statement in the rendering core.

Simply by defining the ConfigurationDocument  as a public NotesDocument variable in RenderEngine.SideBlocks's (Declarations)-section;

A picture named M2

Note that the Execute statement can only interact with public variables as defined above.

Down in the SideBlockCode function I have added the following code;

A picture named M3

This sets the ConfigurationDocument  NotesDocument as a reference to the existing configDoc, and voila, we can now access all configDoc-items in Code Snippits simply by referencing it's items, such as this;

A picture named M4

Why the long ConfigurationDocument? Perhaps it's easier to remember for "not that raw programmers" ?!? What do you think?

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Calendar

Search Site

Tag Cloud

Domino BlogSphere
Version 3.0.2

A Code Snippit

The Home URL of this db is http://dev.blogsphere.net/blogsphere/bsphere3.nsf