View Full Version : wiki.comments function
lamcro
03-06-2008, 07:41 PM
List of all comments, in chronological order, in this page and it's subpages:
{{ wiki.comments("/IT/projects/") }}
List of comments of all comments, in chronological order, just for this page:
{{ wiki.comments("/IT/projects/",1) }}
I could have this code in the main page ("/IT/projects/"), and not have to search through all my pages.
SteveB
03-07-2008, 06:38 PM
Note a bad idea. I filed a ticket for it:
http://bugs.opengarden.org/view.php?id=3535
lamcro
03-08-2008, 02:18 PM
use the feed extension as an example.
To make a tree list of all comments, first line only:
{{ comments.list ("/it/bugs/") }}
To make a linear list, with full comments, or just a bigger piece:
{{ comments.table ("/it/bugs/") }}
SteveB
06-06-2008, 12:39 AM
I closed the issue as you can now very easily enumerate comment objects on any page. Just switch to HTML mode and enter the following text:
<ul>
<li foreach="var c in wiki.getpage('it/bugs').comments">{{c.text}}</li>
</ul>
mikon
06-30-2008, 06:05 PM
:confused:
I can't get this to work on my wiki (excellent wiki by the way).
When I save the page, my wiki returns:
referencia al nombre indefinido 'c'
something like: "Reference to undefined name 'c' " :confused:
We're using:
Deki Wiki 1.8.2b (rev. 7540) running on: Linux 2.6.18-4-686, PHP 5.2.0-8+etch7, mySQL 14.12 distribution 5.0.32, and Mono 1.2.2.1.
I really need this to work.
Thanks in advance!!! :)
Mikon
neilw
06-30-2008, 09:31 PM
Mikon: You probably need a newer version of Deki to make that work. "Foreach", at least its XML version, requires version 1.9.1 according to the docs (http://wiki.developer.mindtouch.com/MindTouch_Deki/DekiScript/Reference/DekiScript_XML_Statements). I speculate that the HTML version, as shown here, requires the same version (is this true?)
The highly useful wiki.getpage() function is, however, undocumented (http://wiki.developer.mindtouch.com/Deki_Wiki/DekiScript/Reference/Wiki_Functions_and_Variables) (hint hint ;)), so I don't know when it came onto the scene.
In any case, to do cool stuff like this you really need to upgrade. The Dekiscript improvements with each new release have been worth the upgrade all by themselves.
mikon
07-07-2008, 09:16 PM
:o Definitely we have to upgrade. You´re right. We're missing too many features that this excellent wiki has to offer.
Wiki upgrade planning in progress... ;)
Thanks a lot!
Mikon
SteveB
07-07-2008, 09:29 PM
8.05.1 is a requirement for wiki.getpage and the foreach attribute.
Powered by vBulletin™ Version 4.1.3 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.