Article Listing

Author: Webvanta

Displays an article. Used on both the list and item pages in the standard Knowledgebase system.

This design uses CSS rules to make this same snippet generate different output depending on the ID of the surrounding element, so it can show different things on list pages and item pages:

  • On a list page, the comments links go to the comments anchor on the item page, and the "continue" link is shown.
  • On an item page, the continue link is not shown.
<w:kb:item>
  <w:kb:edit>
    <h2><a href='<w:path url="/item" />'><w:name /></a></h2>
    <p>By <w:author />, Posted <w:created_at format='%m/%d/%y %I:%M %p' />    
      <span id='comments_links'>
      <w:if_comments>
        <a href='<w:path url="/item" />#comments'><w:comment_count /> comments</a>    
      </w:if_comments>
      <a href='<w:path url="/item" />#comment_form'>Add your comments</a></span>
    </p>
    <div id='article_description'>
      <w:description />
    </div>
    <div id='article_body'>
       <w:body />
    </div>
  </w:kb:edit>
  <p id='continue_link'><a href='<w:path />'>Continue reading...</a></p>
</w:kb:item>