After a lot of experimenting and searching through this forum I solved a little, but important(at least to me) feature for the MODx BLOG.
I’m quite new to MODx, and all I do is just asking at these forums, so finally I think its time to make a humble contribution with this guide, enjoy
How to Display the Author (Full Name) and Published Date below the title(or wherever you want) on your single post page.
Requirements:
1.
http://modxcms.com/PHx-1006.html"" target="_blank" rel="nofollow">Download the PHx Plugin and install it according to its instructions
2.
http://modxcms.com/AuthorTimestamp-1.2-0.html"" target="_blank" rel="nofollow">Download the AuthorTimestamp Snippet and again install it according to its manual
3. And UltimateParent Snippet 2.0 beta which is already included in the newest version of MODx, but if for any reason you don’t have it installed you can find it in quotes
http://modxcms.com/forums/index.php/topic,1290.msg140067.html#msg140067"" target="_blank" rel="nofollow">here (you have to delete a few lines at the end in order to function.
Here is the guide:
1. Create a new Template Variable with a name authortimepost, and put this inside (Default Value:) :
- Insert this if you have a simple blog without categories:
[+phx:if=`[[UltimateParent]]`:is=`2`:and:isnot=`[*id*]`:then=`[[AuthorTime]]`:else=``+]
*where the number 2 is the ID of your Parent Blog Document where all of your documents are contained.
- Insert this if you have your single post documents in Document Containers as categories:
[+phx:if=`[[UltimateParent]]`:is=`48`:and:isnot=`[*id*]`:and:if=`[[UltimateParent? &topLevel=`2`]]`:is=`11`:and:isnot=`[*id*]`:or:if=`[[UltimateParent? &topLevel=`2`]]`:is=`22`:and:isnot=`[*id*]`:or:if=`[[UltimateParent? &topLevel=`2`]]`:is=`33`:and:isnot=`[*id*]`:then=`[[AuthorTime]]`:else=``+]
*2 - ID of the Blog Parent Document
11 - ID of the First Category
22 - ID of the Second Category
33 - ID of the Third Category
If you want to add one more category, simply add this code:
:or:if=`[[UltimateParent? &topLevel=`2`]]`:is=`44`:and:isnot=`[*id*]`
right next to this code:
:or:if=`[[UltimateParent? &topLevel=`2`]]`:is=`33`:and:isnot=`[*id*]`
(And Don’t forget to assign the Template Variable to the template you use)
2. Edit your template and call out the authortimepost Template Variable you’ve just created right below the title. Search for:
<h2>[*longtitle*]</h2>
[*#content*] </div>
and insert your Template Variable [*authortimepost*] between the two like this:
<h2>[*longtitle*]</h2>
[*authortimepost*]
[*#content*] </div>
3. Make sure you check out the Cacheable to every document where you want the date/author to appear, because otherwise it won’t show, at least that was the case for me.
And that should be it.