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]]`
¬ifyEmails=`[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!