We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22895
    • 19 Posts
    Okay, I have followed every example of the basic blog in the Wiki, etc. but somehow cannot get a basic blog functionality working. I have the latest rev of MODx installed and most of the site is developed with only minor tweaks to be done. Is there ANYONE out there that can clearly post some example code of a working, clean blog that will produce the following:

    Blog main page
    - summary of 4-5 posts w/ pagination
    - summary
    - title
    - author, tags (that work), comments (#)


    Blog entry
    - title
    - author, tags (that work), comments (#) *anchored to the comments field
    - content body
    - comments (jot) field *moderated
    - comments, paginated

    Sorry if this has been covered before, but I’ve truly tried the examples I could find here and none seem to work properly.

      • 22895
      • 19 Posts
      Thanks, while I appreciate that it can be frustrating for more sr. developers, what I am trying to achieve is more of a blog format, not just the default page that is installed with Modx. For example, how would I create this?: http://modxcms.com/blog.html

      Every attempt I’ve made had failed results, in either the pagination, the tags not linking individually (rather as a group of tag1+tag2+tag3), etc.

      I’m looking for the fastest path to the simplest blog.

      Title
      author | tags | date | comment (#)
      content
      comments (moderated)

      Not sure what I’m missing, as I’ve managed to get every other aspect of the site functioning with Feedx, eForm and all the other basics like Ditto and Wayfinder.

      Is there not a simple template out there? Sorry if I sound frustrated, it’s again something that should be straightforward that is somehow obscured by the "flexibility" of Modx.
        • 3749
        • 24,544 Posts
        I just took a quick look at the code for the Team Blog. The Blog actually uses the NewsListing (nl) snippet (Version 6.3) rather than Ditto and appears to be integrated with SMF so I’m afraid it’s not going to much help here.

        Here’s the full content of the main blog page in case it gives you any ideas:

        <img src="http://modxcms.com/assets/images/pen.jpg" alt="pen" />
        <p>Random thoughts about life, technology, MODx, and anything in between. </p>
        
        <div id="nl_wrapper"> [[nl? &startID=`254` &tpl=`nl_blog_tpl` &summarize=`5` &commentschunk=`FormBlogComments` &paginate=`1` &dateformat=`%d-%b-%y` &alwaysshow=`1` &trunclen=`500` &truncText=`Read more...` &multilevel=`1` &filter=`hidemenu, 0|parent, 254,2`]] </div>
        <div class="nl_paging">Showing <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> Articles<br />
        
        <div id="nl_pages"> [+previous+] [+pages+] [+next+] </div>
        <!-- close .nl_paging -->   <a href="[~274~]?id=[*id*]" style="border-bottom: medium none; float: right; margin-right: -1em; margin-top: -25px;"><img border="0" src="http://modxcms.com/assets/images/greenzi/icons/rss.jpg" alt="RSS feed icon" /> </a> </div>


        Here’s the nl_blog_tpl chunk:

        <div class="nl_article">
          <h3 class="nl_title">
            <span class="nl_info">   <strong><a href="[~[+parent+]~]">[+author+]</a></strong> on [+date+]</span><a href="[~[+id+]~]">[+title+]</a> 
          </h3>
        
          [+summary+]
        
          <p class="nl_link"><a href="[~[+id+]~]#comments">Comments ([!UserCommentsCount?docid=[+id+]!])</a> | [+link+]</p>
        </div>
        


          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 22895
          • 19 Posts
          Thanks, I’ve resorted to some simple Ditto functions (like tags) and Jot to get close to the desired effect. Now if I can crack how to make a navigation from the tags, I’m almost satisfied!
          wink