Apple Computer Hardware Computer Hardware User Manual


 
Chapter 1 Customizing How the Wiki Looks 27
JavaScript Example
The following example JavaScript function adds a header link next to the magnier
button that points to www.apple.com, and changes the “Other Wikis” link to point to
www.apple.com:
Event.observe(window, 'load', function() {
// add another header link (to apple.com) by manipulating the DOM
// using script.aculo.us Builder
// we'll just insert it before the search button
if ($('linkSearch')) {
$('linkSearch').parentNode.insertBefore(Builder.node('li',
{id:'linkApple'}, [
Builder.node('a', {href:'http://www.apple.com'}, 'apple')
]), $('linkSearch'));
}
// change the Other Wikis link to something else
if ($('groups_users_button')) {
$('groups_users_button').down('a').href = 'http://www.apple.
com/';
}
});
To use this example JavaScript code, save it as a .js le in this folder:
/Library/Application Support/Apple/WikiServer/Themes/theme_name/
About XSL
XSL denes XML document transformation and presentation. For information about
XSL, see:
www.w3.org/Style/XSL/
The wiki server uses a set of XSL les located at:
/usr/share/wikid/lib/apple_templates/
Because a software update can overwrite les in /usr/share/wikid/lib/
apple_templates/, edit the copies of these XSL les located in:
/Library/Application Support/Apple/WikiServer/Themes/theme_name/
XSL les in this location override XSL les in /usr/share/wikid/lib/apple_templates/.
If a software update overwrites the les in /usr/share/wikid/lib/apple_templates/, you’ll
need to manually merge the changed contents of your customized XSL les with the
updated XSL les. If you don’t merge the contents, the versions won’t match and an
error will occur.