Using some simple DekiScript and creative tagging it is possible to simulate a blog in MindTouch Deki. The core idea behind this solution is that the powerful features available to you on the canvas of Deki enable the creation of rich media posts.
The setup is very simple. Add a template called Blog to your Deki installation which contains the following format in HTML source view.
<h1>Blog for {{ site.name }}</h1>
<div init="var ix = wiki.getsearch{query: 'tag:blogpost', sortby: '-date'} " style="width: 550px;">
<div foreach="var p in ix" style="margin-bottom: 80px; background-image: url(http://demo.mindtouch.com/@api/deki/files/2619/=h4_bg.gif); background-repeat: repeat-x;">
<div style="width: 50px; float: left; padding-top: 1px;">
{{ web.image(uri.build('http://www.gravatar.com/avatar',p.author.emailhash,{s:'50'})) }} </div>
<div style="margin-left: 60px;"> <span style="color: #6a7983; font-size: 30px;">{{web.link(p.uri, p.title); }}</span><br /><span style="font-size: 11px; color: #999999;">{{ date.date(p.date); }} last updated by {{ p.author.name }} @ {{ date.time(p.date) }}</span> </div> {{ <br />
if (p.namespace == "") <br />
{ wiki.page{path: p.unprefixedpath} } <br />
else <br />
{ <br />
wiki.page{path: p.namespace .. ":" .. p.unprefixedpath} } <br />
}}
<div style="border: 1px solid #999999; padding: 5px; background: #efefef none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 11px;">
<ul style="margin: 0px; padding: 0px; overflow: hidden;">
<li style="margin: 0px; padding: 0px; list-style-type: none; float: left;"><strong>Tags: </strong></li>
<li style="list-style-type: none; float: left;" foreach="var t in p.tags">{{web.link('/Special:Tags?tag='..t.value,t.value)}}</li>
</ul>
<ul style="margin: 10px 0px 0px; padding: 0px; overflow: hidden;">
<li style="margin: 0px; padding: 0px; list-style-type: none; float: left;"><strong>Viewed: </strong></li>
<li style="list-style-type: none; float: left;">{{ p.viewcount; }}</li>
</ul>
</div>
</div>
</div>
<p>
{{ wiki.create{label: "New Blog Post", path: "community/", template: "BlogPost", title: "Please Enter A Title"} }}</p>
Next Use your Blog template on a wiki page
{{ template( "Blog" ) }}
Now any page tagged with blogpost will show on the Blog page in date last edited.
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by
Could new posting to the blog be dynamically created as sub pages of the blog?
Could the “blogpost” tag also be a dynamic construct of the originating blogs name?
Then the pages would be kept logically placed relative to the blog home page
And the dynamic tag would allow multiple blogs to exist within the same wiki.
(and as the mcraven says above the tag needs to be automatically added)
Line 26 of the code seems to invoke a template called 'blogpost' when creating a new blog post. This template isn't referenced anywhere in these instructions. When I created a blank template called 'blogpost' and gave it a tag of 'blogpost' it all started to work fine, which makes sense because line 2 seems to be searching for pages tagged 'blogpost'.
Even the Alternative Blog template calls a template called 'BlogPost' when creating new blog pages (though the search in the Alternative does not rely on tags, but hierarchy)
just call the template with the parameter {{ template("Blog", {location:"Blog"}) }}
<p>{{ wiki.create{label: "New Blog Post", path: $location, template: "BlogPost", title: "Please Enter A Title"} }}</p>
<div init="var ix = wiki.getsearch('tag:blogpost',_, '-date', 'path:' .. $location .. '/*') " style="width: 550px;">
<div foreach="var p in ix" style="margin-bottom: 40px; background-image: url(http://demo.mindtouch.com/@api/deki/files/2619/=h4_bg.gif); background-repeat: repeat-x;">
<div style="margin-left: 0px;"><span style="color: #6a7983; font-size: 18px;">{{web.link(p.uri, p.title); }}</span><br />
<span style="font-size: 11px; color: #999999;">{{ date.date(p.date); }} last updated by {{ p.author.name }} @ {{ date.time(p.date) }}</span></div>
{{<br />
if (p.namespace == "")<br />
{ wiki.page{path: p.unprefixedpath} }<br />
else<br />
{<br />
wiki.page{path: p.namespace .. ":" .. p.unprefixedpath} }<br />
}}</div>
</div>