We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24007
    • 38 Posts
    Really would welcome some guidance on a blog build in MODX revolution ( 2.0.8 )

    Cannot get the blog posts to show up, here is what I have done so far ......

    Have been trying to follow the notes available at http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution

    I have created several templates for my MODX site:-

    Main_Template_Full
    Main_Template_Basic
    Blog_Post

    For my blog I have a container with a resource ID of 2

    Here is a rough schematic of the site tree:-


    Site Root
    Blog {container/resource} (ID=2)
    web technology {container} (ID=34)
    ’---- HTML5 compliancy (document/resource}
    web hosting {container} (ID=36)
    ’---- hosting packages (document/resource}
    Reply to thread {document/resource} (ID=35)
    Testing post {document/resource}

    other page
    another page
    yet another page


    Following the instructions step by step (see link at top of this post)

    I created a blog post template called ’Blog_Post’
    I copied the code from the example into the template
    Notice in the code below I changed the &target=`1` to the number 2 as this is my blog container resource ID

    <p class="post-info">
    Posted on [[*publishedon:strtotime:date=`%b %d, %Y`]] | 
    Tags: [[*tags:notempty=`[[!tolinks? &items=`[[*tags]]` &key=`tag` &target=`2`]]`]] | 
    <a href="[[~[[*id]]]]#comments" class="comments">
      Comments ([[!QuipCount? &thread=`blog-post-[[*id]]`]])
    </a>
    </p>


    In the comments section of the template code I changed the &replyResourceId=`19` to the number 35 (this is the resource ID for my reply to thread)
    <div class="post-comments" id="comments">[[!Quip?
        &thread=`blog-post-[[*id]]`
        &replyResourceId=`35`
        &closeAfter=`30`
      ]]
      <br /><br />
      [[!QuipReply?
         &thread=`blog-post-[[*id]]`
         &moderate=`1`
         &moderatorGroup=`Moderators`
         &closeAfter=`30`
      ]]
    </div>


    I set up a tag template called ’tags’ as per instructions and made it available to the ’Blog_Post’ template

    I wanted sections in my blog (categories) so that is why I created my containers web technology and web hosting

    I inserted the code below into both of my categories content area (TinyMCE toggled off)
    [[!getResourcesTag?
      &element=`getResources`
      &elementClass=`modSnippet`
      &tpl=`blogPost`
      &hideContainers=`1`
      &pageVarKey=`page`
      &parents=`[[*id]]`
      &includeTVs=`1`
      &includeContent=`1`
    ]]
    [[!+page.nav:notempty=`
    <div class="paging">  
    <ul class="pageList">  
      [[!+page.nav]]  
    </ul>  
    </div>
    `]]


    Next I set up the blog post chunk using the example code - chunk name is ’blogPost’ notice I have also changed the &target=`1` to the number 2
    <div class="post">
        <h2 class="title"><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h2>
        <p class="post-info">Posted by [[+createdby:userinfo=`fullname`]]
     [[+tv.tags:notempty=` | <span class="tags">Tags: 
    [[!tolinks? &items=`[[+tv.tags]]` &key=`tag` &target=`2`]]
    </span>`]]</p>
        <div class="entry">
        <p>[[+introtext]]</p>
        </div>
        <p class="postmeta">
          <span class="links">
    <a href="[[~[[+id]]]]" class="readmore">Read more</a>
    | <a href="[[~[[+id]]]]#comments" class="comments">
        Comments ([[!QuipCount? &thread=`blog-post-[[+id]]`]])
      </a>
    | <span class="date">[[+publishedon:strtotime:date=`%b %d, %Y`]]</span>
          </span>
        </p>
    </div>


    Finally I inserted the following code into the content area of the blog container (ID=2) *The blog container is assigned the Main_Template_Basic template

    [[!getResourcesTag?
      &elementClass=`modSnippet`
      &element=`getResources`
      &tpl=`blogPost`
      &parents=`34,36`
      &limit=`5`
      &includeContent=`1`
      &includeTVs=`1`
      &showHidden=`0`
      &hideContainers=`1`
      &cache=`0`
      &pageVarKey=`page`
    ]]
    [[!+page.nav:notempty=`
    <div class="paging">  
    <ul class="pageList">  
      [[!+page.nav]]  
    </ul>  
    </div>
    `]]

      • 17249 ☆ A M B ☆
      • 165 Posts
      Maybe i can help you, i’ve recently finished a website implementation with blog structure using the code from the link above using MODx Revo 2.0.8-pl
      Everything went easy and fast. Very happy with the results.

      http://www.titanes.com.do

      I took a fast look at your code and seems to be good to go.
      What exactly is the problem? The posts are not showing when going to 34,36?
      Have you unchecked the Hide from Menus option for all resources under your categories folder in the Edit Resource Window?
      Are the documents published?

      Do you already have some test resources under the folders?
      What happens when you hit the Preview button after saving a resource?
        • 24007
        • 38 Posts
        Firstly thanks for the reply..

        I unticked the hide from menus boxes and yes this worked... Excellent.

        However I do have an uncategorized post called test post that does not show up on the blog page. (that is the page is in the blog container but not inside a category subcontainer.

        When I click on the read more I can read the post but there are no comment facilities/options, clicking on the title of the blog post takes me back to the home page of my website so pretty much suspect a link issue there.

        Anything else you can think of perhaps?

        Regards,

        Jay
          • 17249 ☆ A M B ☆
          • 165 Posts
          Make sure that this post is not a container(even it doesn’t have child resources), also check if published and not hidden from menus.
          If something differs from the links inside the ’blogPost’ Chunk check well you place the same code in these two lines:

          Here:
          <h2 class="title"><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h2>


          And Here:
          <a href="[[~[[+id]]]]" class="readmore">Read more</a>


          Also check if you have the same code in the blog, and child folders where the things are going good. Maybe good practice to place that code in another chunk instead of the resource folder ’content’ field and then place your chunk call in all 3 of them so its easier to maintain only editing a chunk. (if you are planning the exact same behavior in all of them).



          UPDATE: Also check the template of this post. Should be the same as your other posts resources. This may be a good time to clear the cache. That’s the only reason i can figure out why you are not seeing the comments.

          Also i recommend you not moderate the comments first until you get a read of a Security Tutorial, it can be overwhelming for new users. Leave that for the end and concentrate on doing the blog functionality first.

          Here’s a tutorial for when you have the time to get into.
          http://bobsguides.com/revolution-permissions.html

          You can ’unmoderate’ changing this in all your QuipReply calls:
          &moderate=`1` to &moderate=`0`

          What do you mean by facilities/options? Sorry my english is not the best. smiley

          Good luck.