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>
`]]