This is a simple notebook application. Below it shows the notes attached with a button to create new notebook notes that contain automatically pre-filled content.
<p>{{ wiki.create{label: "Add a note", template: "NotebookPage", title: date.format(date.now, "yyyy MMMM, d") .. ' (' .. user.name .. ')' } }}</p>
<ul>
<li foreach="var p in page.subpages">{{web.link(p.uri, p.title)}} <span style="color: rgb(128, 128, 128); font-size: small;">({{#p.comments}} comments)</span><br />
{{ var h = wiki.page(p.path); h["//*[@class='summary']"] }}</li>
</ul>
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by
I don't want to turn a note private, I just want the users to access the notes in a "News page" but as should be hundreds, maybe thousands, of notes, I wouldn't like to show them in the left menu.
How can I do that?
Thanks! edited 07:21, 5 Feb 2009
<p>{{ wiki.create{label: "Add a note", template: "NotebookPage", title: date.format(date.now, "yyyy MMMM, d") .. ' (' .. user.name .. ')'} }}</p>
<div init="var ix = wiki.GetSearch{ query: 'path:' .. string.Replace( page.Path, ':', '\\:' ) .. '/*', sortby: '-date', type: 'wiki', max: $max_items ??, constraint: $constraint ?? '' }">
<ul>
<li foreach="var p in ix" style="margin-bottom: 0.8em;">{{web.link(p.uri, p.title)}} <span style="color: rgb(128, 128, 128); font-size: small;">({{#p.comments}} comments)</span><br />
{{ var h = wiki.page(p.path); h["//*[@class='summary']"] }}</li>
</ul>
</div>
When used as a template, you can pass in the arguments max_items and constraint to restrict the display. I also discovered that you can send these note topics to pages with the talk: prefix, but for my purposes I'd rather have them in the left nav.
<li foreach="var p in list.sort(map.values(page.subpages), _, _, '-date.compare($left.revisions[0].date, $right.revisions[0].date)')">
@rberinger: I can't seem to recreate this issue with talk pages you are having, can you clarify? edited 15:16, 12 Jun 2009