Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Customizing wiki templates?

I have been trying to tweak the wiki pages to my liking in Leopard server. The web guide only has one paragraph about editing the theme.plist file in /Library/Application/Support/Apple/WikiServer/Themes/
wireframe.wikitheme/. I have taken out the comment to keep the theme hidden and that works. I can now select the wireframe theme in my wiki's. However the custom sidebar code seems to break the welcome page if I uncomment it. What I would like to do is have custom sidebar items and also have the sidebar show up in all my wiki pages. After messing around I found that I can take the example sidebar code and put it in the metadata.plst file under the groups wiki folder. This actually works. I don't know enough html or css to get this to show up for all pages. Has attempted to customize this yet?

Mac OS X (10.5)

Posted on Nov 1, 2007 11:39 AM

Reply
18 replies

Nov 2, 2007 6:06 PM in response to David Miller17

There are two kind of files:
- the templates located in /usr/share/wikid/lib/apple_templates ( files with extension .xsl)
- the themes in /Library/Application Support/Apple/WikiServer/Themes

On my server the page /groups/ was with the black apple theme so I have modified /usr/share/wikid/lib/apple templates/grouplisting.xsl to get my theme on every pages.

If you understand french you will find my Wiki about 10.5 Server here : http://notreserveur.org/groups/macosxserver/ and the modified /groups/ page here : http://notreserveur.org/groups

Nov 3, 2007 2:40 PM in response to cmondies

Note that if you modify the files in /usr/share/wikid/lib/apple_templates they will get overwritten in an update. If you want to have your own xsl templates, you can copy the ones you want to modify and place them into a custom theme.

xsl files with the correct names located in theme bundles will get loaded by the wiki server on launch. Then those alternate xsl files will get used when building html pages with that custom theme.

Right now /groups/ won't use a theme other than the black X Server theme, so modifying the file /usr/share/wikid/lib/apple templates/grouplisting.xsl is the only way to change that page. But note that those files are likely to get overwritten in an update. For pages other than /groups/ and /users/ it is best to go through a custom theme to change the layout of the page.

Dec 15, 2007 5:57 AM in response to John Anderson1

I've also tried moving the xsl files to within the themes and the edited files do not show as modified in the browser even after restarting the server.

Please can someone check what I have done and let me know whether this is correct.

The first thing that I did was to follow James Craig's instructions in a different post.

James Craig wrote:
cd /Library/Application\ Support/Apple/WikiServer/Themes/

There is a directory for each theme. You can create your own themes here, or create copies of the theme directory. For example:

sudo cp -r float.green.banner.wikitheme/ mytheme.wikitheme
sudo cp wireframe.wikitheme/theme.plist mytheme.wikitheme/

Then edit the theme.plist file copied from the wireframe theme.

1. Change the displayName from "Wireframe Theme" to "My Custom Theme".
2. Change the name from "com.apple.wireframe" to your own unique ID.
3. Change the "selectable" key to true (or remove the key/value pair).
4. Uncomment the "sidebars" key/value pair. NOTE: The "Upcoming Events" sidebar dict needs a UID key/value; either add one or leave that dict commented.
5. Save the file.


The next thing I did was to copy the XSL into the custom theme folder as per John Anderson's instructions.

John Anderson1 wrote:
You should start with the templates already in /usr/share/wikid/lib/apple_templates and copy them into your template folder. Never edit these files in-place -- we will end up overwriting them in a software update! Copy the xsl files into your custom theme. The theme will need to be selected in that specific group wiki's settings in order for the new xsl files to be used.


I have restarted the server with:

sudo serveradmin stop teams;sudo serveradmin start teams

and I have restarted the web service but the changes do not take effect.

If I modify the files directly in /usr/share/wikid/lib/apple_templates then the changes are effected.

So my theme folder looks like this:

pwd: /Library/Application Support/Apple/WikiServer/Themes/ooai.wikitheme

folder contents:

-rwxrwxrwx 1 root _teamsserver 14K Dec 14 23:45 all_settings.xsl*
-rwxrwxrwx 1 root _teamsserver 921B Dec 14 23:45 all_tags.xsl*
-rwxrwxrwx 1 root _teamsserver 2.2K Dec 14 23:45 calendar_entry.xsl*
-rwxrwxrwx 1 root _teamsserver 5.7K Dec 14 23:45 calendar_grid.xsl*
-rwxrwxrwx 1 root _teamsserver 2.1K Dec 14 23:45 comment_entry.xsl*
-rwxrwxrwx 1 root _teamsserver 2.5K Dec 14 23:45 comment_listing.xsl*
drwxrwxrwx 6 root _teamsserver 204B Dec 14 22:59 compressed/
-rwxrwxrwx 1 root _teamsserver 5.3K Dec 14 23:45 content_entry.xsl*
-rwxrwxrwx 1 root _teamsserver 3.9K Dec 14 23:45 content entrylisting.xsl*
-rwxrwxrwx 1 root _teamsserver 12K Dec 14 23:45 default.xsl*
-rwxrwxrwx 1 root _teamsserver 7.9K Dec 14 23:45 directory.xsl*
-rwxrwxrwx 1 root _teamsserver 5.9K Dec 14 23:45 error.xsl*
-rwxrwxrwx 1 root _teamsserver 1.3K Dec 14 23:45 folder_listing.xsl*
-rwxrwxrwx 1 root _teamsserver 9.8K Dec 14 23:45 group_listing.xsl*
-rwxrwxrwx 1 root _teamsserver 2.3K Dec 14 23:45 grouphome.xsl*
-rwxrwxrwx 1 root _teamsserver 760B Dec 14 23:45 loginpage.xsl*
-rwxrwxrwx 1 root _teamsserver 1.2K Dec 14 23:45 mail archivelisting.xsl*
-rwxrwxrwx 1 root _teamsserver 2.1K Dec 14 23:45 moderate.xsl*
-rwxrwxrwx 1 root _teamsserver 8.0K Dec 14 23:11 preview.png*
-rwxrwxrwx 1 root _teamsserver 119B Dec 14 23:11 print.css*
-rwxrwxrwx 1 root _teamsserver 1.5K Dec 14 23:45 revision_listing.xsl*
-rwxrwxrwx 1 root _teamsserver 117B Dec 14 23:11 screen.css*
-rwxrwxrwx 1 root _teamsserver 5.9K Dec 14 23:45 search.xsl*
-rwxrwxrwx 1 root _teamsserver 365B Dec 14 23:27 theme.plist*
-rwxrwxrwx 1 root _teamsserver 2.3K Dec 14 23:45 weblog_listing.xsl*

In the blog the settings have been changed to load this new theme.

So what am I doing wrong?

Cheers
Craig

Jan 3, 2008 5:02 PM in response to John Anderson1

Hi John

I have the same concerns; I chose the route of modifying the default apple templates, so I've made many changes to the default.xsl, group_listings.xsl files, the serverhome CSS files, etc. You can check out my subtle customizations at http://www.newmachinestudios.com/. I've had a **** of a time trying to keep the system running while I made my changes but (knock on wood) I think I've figured out how to resurrect the users/groups functionality every time.

However, I want to immunize my installation from an upgrade as well. I copied the entire contents of the Collaboration directory into my web root folder and eliminated the aliases, so that I could make the changes there and leave the default stuff alone, but I want to be able to have a full compliment of the custom .xsl files there too (contained in a theme) so that no matter what happens I am upgrade immune.

I looked through all of the .xsl files but what I seem to be missing is where does the system tell apache/tomcat to load /usr/share/wikid/lib/apple_templates in the first place, so that I can change it to point to my custom stuff? I want everything to be nicely contained in one place (it seems to be spread all over the system) so that I can back it up easily.

Or, I've read that if you include customized .xsl files in your template, they will supercede the ones found in /usr/share/wikid/lib/apple_templates, but how exactly does this work? Where specifically do I put them in my theme folder? Is it selective? (i.e. can I just put in the ones I've changed or do I have to put the full complement of files in there for it to work?)

Finally, I wanted to be able to put the theme applets from the sidebar into my static html pages (in much the same way that the default apple index pages seems to load a script that creates a list of available group wikis on the fly). How is this done? Is there a reference book I should read (I'm hunting down the O'reilly Tomcat book already) or a web site that could point me in the right direction?

Thanks in advance for any assistance.

Colin

Jan 8, 2008 9:57 AM in response to ccurwen

Apache only serves as a proxy server to our Twisted-based wiki server, and it serves up a few static "required" JavaScript and CSS files. The server always references xsl templates by name, and looks them up in the theme first. So, if a "name conflict" exists between xsl files in a theme or in /usr/share/wikid/apple_templates, the theme xsl file will always "win." The xsl files should live in the top-level directory of the theme.

Tomcat is not a part of our wiki server infrastructure at all. The sidebar is a combination of extra context info added by the group homepage renderer, extra XSL to display the sidebar in a format which is both human-readable and machine-parseable, and JavaScript to parse the sidebar contents from the HTML, poll the server at regular intervals, and diff the new polled data against the parsed data in order to animate in any new/changed sidebar items.

Jan 13, 2008 9:04 PM in response to John Anderson1

Hey John

Thanks for the info. I think I understand the first paragraph of your answer, and I am going to test this right away. If this is the case then I am very relieved! I will investigate this twisted wiki server (is there a decent mac-aware site where twisted users congregate?)

However, forgive me but I don't think I understood anything in your second paragraph. If I understand you correctly then if I am only running apache with the wiki server I can turn off tomcat or do I need it to power the javascript for the sidebar stuff?

Also, to confirm I'm talking about the sidebar in the default apple index.html page. Where is this extra XSL and the javascript that enable this functionality and how exactly is it called? I think if I could have a look at it then I could get my mind around how it works so that I could make my own calls to display the information that I want (I really just want to be able to show the most recent posts from one of my user blogs) the group home pages already have the functionality I'm looking for and more (i.e. what's hot, recent items, etc.) so I'm cool with that, i just want to be able to have my index page display not only links to the group home pages, but also look for, say, the 5 most recent items in that particular blog and display the title and date, for example.

I'm not a programmer (obviously) so am I way out of my depth here? I have managed to get php/mysql based sites running on my servers no problems, and I've compiled lots of specialty apps (i.e. render farm software) on mac os x so I feel pretty confident that I can figure most things out...?

Jan 14, 2008 9:21 AM in response to ccurwen

Yes, you can turn Tomcat off. JavaScript runs on the client browser, and has nothing to do with Java on the server.

Getting the sidebar on other pages will be a very complicated process. The XSLT which generates the group homepage relies on sidebar data being present in the raw XML handed to it by the server. That sidebar data is only present on the group homepage, so adding the sidebar XSL to other pages won't do any good (since there's no data to act on.)

An experienced web programmer could probably use a theme to include sidebars via JavaScript. In-depth knowledge of JavaScript is required, however.

Customizing wiki templates?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.