Knowledge Base
Latest Blog Posts
Last Post 30 Aug 2009 11:41 AM by DNNDev Admin. 0 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev
You are not authorized to post a reply.
Author Messages
DNNDev AdminUser is Offline
Posts:6314
Avatar

--
30 Aug 2009 11:41 AM  

Posted by angusbeare
I needed a list of the latest blog posts on my site. I'm using the standard blog module which is great but lacks a module for latest posts. So I knocked up an XMP template to do it.

Hope you find it useful.

You will need to tweak the SQL, especially the DNN4 object qualifiers which will probably need to be removed. Note also the blog module table blog_blogs has a field called 'Public' which is a reserved word (bad practice). My guess is this will get changed so watch out for it if you upgrade.


<xmod:template>
  <listdatasource commandtext="SELECT top 5 ble.PermaLink,ble.Title 
                               FROM dnn4_blog_entries ble
                               INNER JOIN dnn4_blog_blogs bb on bb.Blogid = ble.Blogid 
                               WHERE ble.Published = 1 AND bb.Portalid = 30 AND bb.[public] = 'True' 
                               ORDER BY ble.AddedDate DESC" />
  <headertemplate>
    <ul>
  </headertemplate>
  <itemtemplate>
    <li class="Normal"><strong><a href="[[PermaLink]]">[[Title]]</a></strong></li>
  </itemtemplate>
  <footertemplate>
    </ul>
  </footertemplate>
</xmod:template>

Power Your Website With XMod Pro
Buy XMod Pro Today
You are not authorized to post a reply.

Active Forums 4.1
spacer
dummy