We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3866 ☆ A M B ☆
    • 350 Posts
    Ok left coding alone for a cup of tea smiley and returned to relook at code and I see I’ve managed to add [[ ]] around &parents=`[[29]]` if first call - removed those. Then noticed I had also managed to put an extra ] after &parents=`29]` in second call.

    And then to cap it all realised I hadn’t yet downloaded and installed taglister.

    Corrected all of the above and voila, I have a blog!!

    Somewhat embarressed at silly mistakes embarrassed but hey, part of the learning process is being able to correct those mistakes.

    Onwards and upwards grin
      Helen Warner
      Number one pixel!
      Proud to be linked with MODX at Crimson Pixel
      • 17897
      • 46 Posts
      I too am having an issue with the tutorial, sorry for dragging this thread back out, but I figured it’s better than starting another. I followed the tutorial, using copy-paste (using the plain-text pop-up) to create the template and the chunk.

      Critical portion of site structure:
      -Web
      --Blog(21)
      ---2011(22)
      ----01(24)
      -----first-post(23)

      All 4 are set to published. 22 and 24 are set to not show in menu. All except 23 are using the main site template.
      23 is using BlogPostTemplate:
      <div id="content" class="blog-post">
        <h2 class="title"><a href="[[~[[*id]]]]">[[*pagetitle]]</a></h2>
       
        <p class="post-info">
        Posted on [[*publishedon:strtotime:date=`%b %d, %Y`]] |
        Tags: [[*tags:notempty=`[[!tolinks? &items=`[[*tags]]` &key=`tag` &target=`21`]]`]] |
        <a href="[[~[[*id]]]]#comments" class="comments">
          Comments ([[!QuipCount? &thread=`blog-post-[[*id]]`]])
        </a>
        </p>
      
        <div class="entry">
          <p>[[*introtext]]</p>
          <hr />
          [[*content]]
         </div>
      
        <div class="postmeta">
          [[*tags:notempty=`
      <span class="tags">Tags: [[!tolinks? &items=`[[*tags]]` &key=`tag` &target=`21`]]</span>
          `]]
          <br class="clear" />
        </div>
        <hr />
        <div class="post-comments" id="comments">[[!Quip?
            &thread=`blog-post-[[*id]]`
            &replyResourceId=`123`
            &closeAfter=`30`
          ]]
          <br /><br />
          [[!QuipReply?
             &thread=`blog-post-[[*id]]`
             &notifyEmails=`[email protected]`
             &moderate=`1`
             &moderatorGroup=`Moderators`
             &closeAfter=`30`
          ]]
        </div>
      </div>


      Item 21 has the following code set in the content:
      [[!getResourcesTag?
        &elementClass=`modSnippet`
        &element=`getResources`
        &tpl=`blogPost`
        &parents=`21`
        &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>
      `]]


      blogPost Chunk:
      <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=`21`]]
      </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>


      Nothing is set in the content for the 2 containers 22 and 24, and 21 IS set as container.

      So page 21 (the blog home page) shows fine and displays the links for the (only) post. Tags, comments, and the title all link to the proper places. However, when viewing the actual post, all of the links there are broken. What is going on is that the path for the title link is: [site_root]/blog/2011/01/blog/2011/01/first-post.html. The tags links are: [site_root]/blog/2011/01/blog/?tag=news&key=tags (the tag on the blog post is news). The comments link looks much like the title one: [site_root]/blog/2011/01/blog/2011/01/converting-to-use-cms.html#comments. The content of the post does show up properly.

      It is clear to me that something is off with the link calls, I just haven’t been able to figure out what. I’ve spent a few hours playing around trying to fix this to no avail. If someone knows what I have wrong here (likely something stupid, I am still fairly new to modX) please help me out here. I can provide any additional information needed if I missed something.

      Thanks!
        • 22019
        • 390 Posts
        Does the page template that you are using for resource 23 include this between the head tags?:

         <base href="[[!++site_url]]" />  


        I think that’s all it is - definitely rings a bell from the forums anyway....

        The tutorial assumes you have set the base tag in the $pageHeader chunk, but it doesn’t explicitly say so.

          Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
          • 17897
          • 46 Posts
          Well, no I hadn’t defined any <head> yet. I thought I was being clever by not worrying about it yet, guess that shows me. Adding the <head> with that callout fixed the links adding the blog/ directories again, but the tag links still have one issue. The links for the tags on both resources are inserting an extra "/" right before the query string call. I’ll keep poking around as it is now really close, maybe I can figure out where the extra "/" is coming from, but if you have an idea, I’m all ears. Thanks odeclas!
            • 17897
            • 46 Posts
            Well I got the display of the tags to work correctly by changing resource 21 (the blog home) to not be a container. Now it properly generates /blog.html?tag=news&key=tags on both pages. Unfortunately this link returns a 404 error, so now I’m looking at that issue.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              It’s a good idea to get your page to validate before trying to track down obscure bugs. Bad HTML can account for a lot of problems.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 17897
                • 46 Posts
                Quote from: sottwell at Jan 16, 2011, 01:08 PM

                It’s a good idea to get your page to validate before trying to track down obscure bugs. Bad HTML can account for a lot of problems.
                Yes, well that was my mistake I forgot I hadn’t added it yet. But it validates fine now, but the tags links are broken, everything else is fine.
                  • 17897
                  • 46 Posts
                  Still no dice on getting the query string working. By changing the main resource to not be run as a container it builds the string, but the link is a dead link. I’ve got no ideas at this point what the problem could be, I’m hoping someone out there does? I’m so close to having this running...
                    • 17897
                    • 46 Posts
                    Still getting 404 errors on the tag links. I switch the blog home (21) back to container as I realized I was being stupid the other day and that the query string is being built fine, it just isn’t working. Is it possible that this could be related to a friendly URLs issue? I am running IIRF an a Win Server 2003 box, I’ll post my rewrite rules if someone thinks that could be the problem. Please, someone must have an idea at least to try?
                      • 17897
                      • 46 Posts
                      I have tracked this down to a definite issue with Friendly URLs as turning them off sees everything behave perfectly. I moved this issue to the IIS hosting issues forum, hopefully a solution will turn up there for anyone else having this issue in the future. http://modxcms.com/forums/index.php/topic,60036.0.html