Object reference not set to an instance of an object.
Object reference not set to an instance of an object.
Custom Borders
.
Summary

Every FlexWiki page has four borders whose contents are customizable:

TOP BORDER
LEFT BORDER ................................ RIGHT BORDER
BOTTOM BORDER

Three Levels of Topic - Borders property in the topic

In each of these cases, you specify one or more BorderSets that should apply at the given level(federation, namespace or topic). You can specify more than one BorderSet topic, just separate the list with commas.

Customization Scenarios

There are five (count them!) common customization scenarios:

These are described below....

Customize the borders for the whole site

To customize the borders for the whole site, you must set the <borders> element in the FederationNamespaceMap. For example:

 <FederationConfiguration>
   <Borders>MyWiki._NormalBorders,MyWiki.MyBorders</Borders>
   ...
Note

In this example, we show first the explicit inclusion of the _NormalBorders for the federation (taken from a specific namespace) and then we list our custom BorderSet called MyBorders.

Then in the MyWiki.MyBorders topic, add one or more of the key border properties (see above). For example, to add a standard copyright notice to the bottom of every page on your FlexWiki site, you could have a MyBorders topic that looks like this:

Note
You might want to add that you must change the word MyWiki above to the name of your Wiki -- JimKenzig Name of wiki = namespace. To change the word MyWiki, click the 'Rename' link on the left.
 BottomBorder: Copyright © 2004, Some Organization.  All Rights Reserved

Note that the names of any topics given here for TopicSets must be in fully-qualified form with the namespace specified.

Q: I must be doing something wrong, or something is not working correctly. I've added the <Borders> element to the federationNamespaceMap file as described above. Then I created a new MyBorders topic and added the same BottomBorder as described above. At this point, I get the copyright notice in the bottom border of the MyBorders page, and any oage that is referred to from this page. However, if a page is not linked from here (examples include the HomePage) the custom border does not apply. I'm guessing that, in truth, the custom border is applied to pages created by clicking on a wiki link on the MyBorders page. -- Olorin

Update: a day later, re-logging on to my wiki, it seems that the borders are correctly applied. This might mean that, for the custom borders to take effect you need to restart your browser/your machine or somehow clear the cache. -- Olorin

Update: From what I've seen, FlexWiki uses server-side caching, thus if you'd want instantaneous results, you'd need to do an IIS reset. Many people rely on third party web-hosts, so this may be impractical. In that case you just have to wait it out. -- MikeGradek

Server-side caching can be controlled within IIS. In the Internet Information Services (IIS) Manager, navigate to "Web Sites", right click->Properties->Tab: Home Directory->Click:Configuration->Tab: Cache Options->Select: "Do not cache ASP files".

Workaround

Q: I did the above example and nothing happens. I restarted the IIS and still nothing. -- Arturo Arocha

Note
It appears that FlexWiki uses an application cache to store border settings. You want to restart the FlexWiki app to reload these settings. Restarting IIS is one way but another way (better when editing on your service provider) though is to force FlexWiki to reload by opening and saving FlexWiki's web.config (just to change its timestamp). In each case existing FlexWiki sessions may be interrupted. - MatHobbs

Newbie "Template" For Adding A Simple Top Border

This is what I added to my _NormalBorders file to include another Wiki page containing a table.

To me, it was very non-obvious how to do this from the existing examples, so I hope this is useful to others!

The modification noted at the top as "necessary" is nowhere in my FederationConfiguration

(FederationConfiguration itself seems only to live in NamespaceMap.xml as far as I can tell).

I added this to my _NormalBorders file (FlexWiki v1.8.0.1677)-

  TopBorder:{
  aTopic |
  ["{{MainLinksHeader}}"]
  }

--MattMcCabe(06/28/2005)

Customize the borders for a single namespace

If you want to add to the borders for all topics in a namespace, you have two choices. First, you can simple modify the existing _NormalBorders topic that is supplied by default (unless you're customized for your federation as a whole). This might be the easiest, but is probably not the best unless you really need to change what's already there rather than add to it. Your second choice is a add a Borders property to the ContentBaseDefinition topic for the namespace. For example, adding this line:

 Borders: MyBorders

Then add a topic called MyBorders and set whatever combination of TopBorder, BottomBorder, LeftBorder and RightBorder you want to include the content you want (see example above).

Note that topic names specified in this property can be relative or absolute.

Customize the borders for a single topic (or group of topics)

Note
Borders
Answer
It does work, there's just considerations. If it is an existing topic, the Borders: DontWorkBorders will not take effect immediately. Server caching is the culprit (as described somewhere else in this topic), and you have to wait for a server refresh (or use the admin page to clear the cache) before it shows up on the topic. If you create a brand-new topic with the Borders: <whatever> then the referenced BorderSet will go into effect immediately. Annoyingly, the Borders: <whatever> will actually show up in the topic at the place it occupies textually, with a box around the BorderSet name. To get around this, pre-pend the Borders: item with a colon, as show below. -- MikeClark, 2005-04-05
 :Borders: TheyDoWorkAfterAll

Sometimes it is nice to add information to the border of a single topic. To achieve this, add a Borders property to the topic you want to add borders to. For example,

 Borders: MyBorders

Then add a topic called MyBorders and set whatever combination of TopBorder, BottomBorder, LeftBorder and RightBorder you want to include the content you want (see example above).

Note that topic names specified in this property can be relative or absolute.

This technique can be particularly useful for a set of related topics. If they all have, for example, some important common backgroud information, you can add it to the border of all of them. Just create the TopicSet that includes the common information and then reference it from a Borders property you add to each of the related topics.

Put links in your left border

If you open your "http://YourServerNameHere/default.aspx/MyWiki/_NormalBorders.html page", you can edit the left border using links like this:

 LeftBorder:{
 aTopic |
        [
        "||{T-T^}", Presentations.Image(federation.LinkMaker.LinkToImage("images/images/fwlogo.jpg")), "||", Newline, Newline,
        MenuItem("The Main Homepage", "Home", "http://YourServerNameHere/default.aspx/MyWiki/Intranet.html"), 
        "----", Newline,
        MenuItem("Search Google", "Google", "http://google.com"), 
        MenuItem("Corporate Homepage", "Corporate", "http://YourServerNameHere/default.aspx/Corporate/HomePage.html"), 
        MenuItem("Customer Support Homepage", "Customer Support", "http://YourServerNameHere/default.aspx/CustomerSupport/HomePage.html"), 
        MenuItem("Finance Homepage", "Finance", "http://YourServerNameHere/default.aspx/Finance/HomePage.html"), 
        MenuItem("Human Resources Homepage", "Human Resources", "http://YourServerNameHere/default.aspx/HumanResources/HomePage.html"), 
        "----", Newline,

- AaronSachs

Question
Question

Put links in your right border

The right border is defined by this the "NamespaceMap.xml" file://YourServerNameHere/DriveLetter$/FlexWiki/WikiBases/NamespaceMap.xml In that file, you will see a line up near the top with code similiar to this in it. That is the code you need to change to edit all of the right borders.

  <About>Need help? Here's a great place to start: MyWiki.OneMinuteWiki, MyWiki.WikiHelp, or "Google":http://google.com</About>

- AaronSachs

Put a new graphic/logo in your top left border

The location of the graphic/logo is defined by the http://www.flexwiki.com/default.aspx/FlexWiki/_NormalBorders.html page.

 LeftBorder:{
 aTopic |
        [
        "||{T-T^}", Presentations.Image(federation.LinkMaker.LinkToImage("images/images/fwlogo.jpg")), "||", Newline, Newline,

See the graphic named: "fwlogo.jpg" ?? It is pointing to the file://YourServerNameHere/DriveLetter$/FlexWiki/images folder.

All you have to do is copy your new custom graphic into that folder and rename it as fwlogo.jpg (or i guess you could rename the link and the graphic both to "whatever.jpg"

- AaronSachs

Question
Aaron - This doesn't work for me I'm getting an error stating: Error evaluating expression: Topic member LeftBorder defined in MyBorders is not well-formed; missing closing '}' for code block. Surely your syntax is wrong?
Answer
 LeftBorder:{
 aTopic |
        [
        "----",
        Newline,
        MenuItem("The Main Homepage", "Home", "HomePage", "images/go.gif"), 
        MenuItem("Search Google", "Google", "http://google.com", "images/go.gif")
        ]
Question
Answer
 LeftBorder:{
 aTopic |
        [
        "||{T-T^}",
        Image(federation.LinkMaker.LinkToImage("images/fwlogo.jpg"), "FlexWiki Logo"),
        "||", 
        Newline,
        Newline,
Answer
JohnMills - The first example is wrong. LinkToImage takes two parameters, not one.
Answer
I kept getting the "Value cannot be null" error too. Presentations.Images (not LinkToImage) expects three parameters. This is what I had to change it to:
  Presentations.Image(federation.LinkMaker.LinkToImage("images/fwlogo.jpg"), "Home", "HomePage")

Borders if you are using the SQL Store

To get the borders to work if you are using a SQL store is slightly different. You need to add a record into the topics table and give it the name NormalBorders and the body needs to be the full borders. The easiest way for me was to find the NormalBorders on this site and copy that into the Body column. Once you do that you can make links on your wiki and edit the record from the wiki (which is much simpler)

Just for kicks I think you may be able to use this INSERT statement to do it.

 INSERT INTO topic (NameSpaceId, Name, lastWriteTime, CreationTime, Archive, Deleted, Writable, Hidden, Body) 
        VALUES (1, '_NormalBorders', getDate(), getDate(), 0, 0, 1, 0, 'the full text of this sites _NormalBorders')

Examples

A few examples of user contributed BorderSets:

A work in progress regarding customizing your borders: CustomizingBorders

Object reference not set to an instance of an object.