We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25315
    • 68 Posts
    Hi guys.

    I’ve trying to make a blog using the example documentation in the revo docs.
    http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution

    I’ve hit another roadbump.

    I’ve adapted the code in the documentation.
    I’m using a template that for my blog page. I expect it to print out my blog posts. I use this code:
    [[$pageHeader?]]
    <div id="blog-container">
    
    [[!getResourcesTag?
      &elementClass=`modSnippet`
      &element=`getResources`
      &tpl=`blogPostTemplate`
      &parents=`16`
      &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>
    `]]
    </div> <!-- blog-container ends -->
    [[$pageFooter]]
    


    Instead of displaying blog posts, it prints a snippet of php code, wrapped in <pre> tags.
    My page looks like this:
    http://imgur.com/58cv4.jpg

    What could be happening here?
      • 28215
      • 4,149 Posts
      splittingred Reply #2, 16 years ago
      It will do that if the "blogPostTemplate" chunk doesn’t exist. Make sure that chunk exists.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 25315
        • 68 Posts
        Quote from: splittingred at Oct 06, 2010, 10:43 AM

        It will do that if the "blogPostTemplate" chunk doesn’t exist. Make sure that chunk exists.

        Do you mean the ’blogPostTemplate’ template?

        I have this template.
        I’ve checked to make sure the capitalisation and spelling of the template name matches whereever it appears.

        The chunk that the tutorial directs you to make is the ’blogPost’ chunk, which I also have.
          • 28215
          • 4,149 Posts
          splittingred Reply #4, 16 years ago
          Then you need to use it in your getResourcesTag call:

          &tpl=`blogPost`


          not: &tpl=`blogPostTemplate`
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 25315
            • 68 Posts
            Thanks Shaun.

            I must have gotten that parameter wrong when I was modifying the call.