Inspired by the Daniel's and Tolleiv's TypoScript talk we had at our office (btw, nice pictures, Andreas!:) this evening, I decided to publish a "monthly category menu" for news/blog records I created a while ago for the TYPO3 Usergroup Karlsruhe. The approach back then was to create a complete blog based on TypoScript only. You'll find the rest of the Extension on Forge. My plan was to replace this blog by the tsblog, but could not find the time to work on it. But still: Interesting stuff...

Now to the snippet that renders a monthly archive grouped by years and showing the amount of posts in that month:

Using the CONTENT cObject it is possible to make custom MySQL-Requests. You can even query new fields like I did with "month", "year", "quantity" and "timeStampOfLastPostInMonth". The values for these fields are available in the cObjects data and can be used in the renderObj for rendering the row content. To display the month name I use a timestamp (the last one in this case) of the month and format it using stdWrap's date function. Using a register I remember the last used year to avoid displaying it more than once, and the rest of the snippet should be self-explanatory. You can use the extension tscobj to place a TypoScript snippet as a content element on a page.

You'll find a demo of this snippet with the posts of my blog here and you can download the source code here.

Comments

This website uses disqus for the commenting functionality. In order to protect your privacy comments are disabled by default.

Enable Comments