Hi all,
I don’t know how you feel about posts of this length so apologies in advance if this is a problem to far!
I’m trying to create a blog page within my website by following the instructions posted here:
http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution
I’ve ran into a couple of issues....first of all to give my query some structure:
Blog page id=30
Category id=45, 46.
I have created a template as instructed using the code from the tutorial:
<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=`30`]]`]] |
<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=`30`]]</span>
`]]
<br class="clear" />
</div>
<hr />
<div class="post-comments" id="comments">[[!Quip?
&thread=`blog-post-[[*id]]`
&replyResourceId=`36`
&closeAfter=`30`
]]
[[!QuipReply?
&thread=`blog-post-[[*id]]`
¬ifyEmails=`
[email protected]`
&moderate=`1`
&moderatorGroup=`Moderators`
&closeAfter=`30`
]]
</div>
</div>
I have created a reply to thread resource (id=36)and created a template for it with the following script:
<h2>Reply to Thread</h2>
[[!Quip]]
[[!QuipReply]]
I have created a TV and named it tags as instructed and made it available to the blog post template.
I’ve created two categories and assigned a base template to them:
[[$Tunedheader]]
<div id="navigation">
[[Wayfinder?&startId=`0`&outerTpl=`menucontainer`&outerClass=`navigation`
&rowTpl=`menurows`&level=`2`&hideSubMenus=`1`]]
[[*content]]
</div>
[[$tunedinfooter]]
And both categories have the following script in their content:
[[!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 blogPost chunk-copied exactly with the following line changed to reflect my blog id:
[[!tolinks? &items=`[[+tv.tags]]` &key=`tag` &target=`30`]]
And finally I inserted the following into the content of my blog page (id=30)
[[!getResourcesTag?
&elementClass=`modSnippet`
&element=`getResources`
&tpl=`blogPost`
&parents=`45,46`
&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>
`]]
The problems I have run into are 1. when creating a resource under categories (assigning them to the blog post template) they do not appear on the blog page (id=30) the pages are not currently hidden from menu and are all published.
2. Wayfinder is picking up the resources and inserting them into my Nav bar (i’m sure i can use the &excludeDocs parameter to remedy this or hide from menu)
Sorry again for the length of the post and thanks for your patience with us newbies.
Dan