MindTouch Developer Center > DekiScript > Samples/FAQ > How do I... Create a Blog in MindTouch Deki?
Table of contents
  1. 1. Summary:
  2. 2. The Setup:

Summary:

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:

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); }}&nbsp; last updated by {{ p.author.name }} @ {{ date.time(p.date) }}</span> </div> {{ <br  />
if (p.namespace == &quot;&quot;) <br  />
{ wiki.page{path: p.unprefixedpath} } <br  />
else <br  />
{ <br  />
wiki.page{path: p.namespace .. &quot;:&quot; .. 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: &quot;New Blog Post&quot;, path: &quot;community/&quot;, template: &quot;BlogPost&quot;, title: &quot;Please Enter A Title&quot;} }}</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.

Tag page
Viewing 2 of 2 comments: view all
One problem. When you click on "new blog post" the page created is not assigned the tag "blogpost" so unless you add it the page will not show up as part of the blog.
Posted 22:01, 4 Sep 2008
very new at this...(sorry if this is completely dumb)
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)

Posted 00:40, 14 Sep 2008
Viewing 2 of 2 comments: view all
You must login to post a comment.
Powered by MindTouch Deki v.8.08.2