Instiki
Creating a Sidebar
- Creating a sidebar
- First, create a new page. We’ll call it “menu.”
- Wrap the text in menu in the following code:
<div class="rightHandSide">
[Your wiki formatted text here.]
</div>
- Make sure to have two blank lines after the closing
</div> tag!
- At the start of any page you wish to include the sidebar, place the following:
[[!include menu]]
- Note: Updates to the included page will only appear on the including page when the including page is updated.
- You can replace “menu” with the name of the page you created for your sidebar. The menu for this site is Home Nav. Click “edit” to see how it’s done, and take a look at the source of the Home Nav page as well.
- Another Note: This trick has the unfortunate side effect of making the “Linked from” section at the bottom of the page pretty useless, because every page that includes the sidebar will show up as a referring page for every item in the Menu. Until someone adds a sane “header” or “sidebar” feature to Instiki, a quick way to disable the “Linked from” section completely is to modify the source file app/models/page.rb. I changed the definition of the method linked_from by commenting out the real code and inserting the line return [] which causes the program to recognize no referring pages whatsoever. This is ugly as sin, and no doubt breaks the test suite too, but so far it hasn’t hurt my wiki a bit.
Revised on August 17, 2007 14:00:06
by
Silvio
(200.122.17.36)