Motivation
My wiki
has a long list of books
, some of which end with '?'. This made a real mess when I hadn't filled in the links. And, I had always wanted more control over how missing page links looked anyhow. So, I wrote a filter that recognizes the HTML that JSPWiki generates for missing page links, and replaces them with a pure CSS span, eliminating the '?' along the way. Now, I can fiddle with the CSS all I like, even replacing the '?' if the broswer understands :after. You can see a screen shot of the result on my Column Filter page. This missing page links are in red.
Technical Details
The key is the filters XML file, where you specify the filter. The filter will then be applied to all pages.
<?xml version="1.0"?>
<pagefilters>
<filter>
<class>com.bradfordholcombe.JSPWiki.filters.EditLinkFilter</class>
</filter>
</pagefilters>
CSS example:
A.needed {
color: #800;
text-decoration:none;
border-bottom: 1px dashed #8f8fff;
}
A.needed:visited {
color: #800;
text-decoration:none;
}
A.needed:hover {
text-decoration:underline;
color:white;
background-color: #ff8f8f;
border-bottom: 1px dashed #ff8f8f;
}
Installation
Drop the JAR in your lib directory, and update your filter XML and CSS files. That should be it. The source code and JAR are below as attachments.Bugs
Please note any bugs or suggestions here. I have tested it extensively on JSPWiki 2.1.103 and Resin 2.1. Let me know if you find any issues.Add new attachment
List of attachments
| Kind | Attachment Name | Size | Version | Date Modified | Author | Change note |
|---|---|---|---|---|---|---|
jar |
EditLinkFilter.jar | 3.0 kB | 1 | 05-Oct-2004 05:07 | BradfordHolcombe | |
java |
EditLinkFilter.java | 2.6 kB | 1 | 05-Oct-2004 05:08 | BradfordHolcombe |