Hi All
I’m a complete beginner to Modx and blogs. I’m following the Creating a Blog in MODx Revolution tutorial, but I cannot get it to work. Any assistance would be appreciated
1. I downloaded getResources,getPage, Quip tagLister ,Archivist.
2. Attached is an image of my resources structure.
3. I created a template called ’BlogPostTemplate’ and put the following content in:
[[$header]]
<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=``]]`]] |
<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=`2`]]</span>
`]]
<br class="clear" />
</div>
<hr />
<div class="post-comments" id="comments">[[!Quip?
&thread=`blog-post-[[*id]]`
&replyResourceId=`10`
&closeAfter=`30`
]]
[[!QuipReply?
&thread=`blog-post-[[*id]]`
¬ifyEmails=`
[email protected]`
&moderate=`1`
&moderatorGroup=`Moderators`
&closeAfter=`30`
]]
</div>
</div>
</div>
<div class="spacer"></div>
</div>
[[$footer]]
</div>
4. Created a TV called ‘tags’. It has access to the ’BlogPostTemplate’ Template.
5. I created my resource sections "Personal" ID 5 and "Technology" ID 6 and made them containers, with a base template. And put the following content in:
[[!getResourcesTag?
&element=`getResources`
&elementClass=`modSnippet`
&tpl=`blogPost`
&hideContainers=`1`
&pageVarKey=`page`
&parents=`[[*id]]`
&includeTVs=`2`
&includeContent=`1`
]]
[[!+page.nav:notempty=`
<div class="paging">
<ul class="pageList">
[[!+page.nav]]
</ul>
</div>
`]]
6. I made my blogPost Chunk, with the following code.
<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=`1`]]
</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>
7. I created my home page for the blog, which i’ve got in Resource ID 13 (called blog). I put the following code in the resource content:
[[!getResourcesTag?
&elementClass=`modSnippet`
&element=`getResources`
&tpl=`blogPost`
&parents=`5,6`
&limit=`5`
&includeContent=`1`
&includeTVs=`2`
&showHidden=`0`
&hideContainers=`1`
&cache=`0`
&pageVarKey=`page`
]]
[[!+page.nav:notempty=`
<div class="paging">
<ul class="pageList">
[[!+page.nav]]
</ul>
</div>
`]]
8. Inside my Personal container , I have created a new blog resource called ‘Events’ and set it’s Template to ’BlogPostTemplate’.
9. Lastly, I’ve specified the tag.
If I click on the events page I can preview my blog. But on my Blog page, icannot see any posts
Please can somebody help, ive redone this tutorial several times, and I’m not sure what’s wrong.
Many thanks
Rob