[TYPO3-mvc] How to create an archive menu of dates from my objects

Henjo Hoeksma me at henjohoeksma.nl
Mon Jul 25 11:39:41 CEST 2011


On 2011-07-25 07:13:03 +0000, Sebastian Schreiber said:

> Hello Henjo,
> maybe this url could help you:
> http://blog.marit.ag/2010/05/26/extbase-fluid-blog_example_amen/
> I think there are plenty of solutions to solve your problem.
> 
> Good luck
> 
> Am 25.07.2011 08:22, schrieb Henjo Hoeksma:
>> On 2011-07-25 06:35:52 +0000, Pankaj Lele said:
>> 
>>> Hello Henjo,
>>> 
>>>> I tried several approaches now on creating a ViewHelper, or rendering it
>>>> with Fluid as is, but all of them to no avail. I clearly lack some
>>>> understanding here and would appreciate it if some of you could point me
>>>> in the right direction!
>>> 
>>> I think one of the idea would be to add 2 new properties year and month
>>> to your Item model. No need to add them to the table actually ( I have a
>>> little doubt if this would work but worth trying. ). Then set these 2
>>> properties in the __contruct() of the model.
>>> 
>>> public function __contruct() {
>>> $this->setYear($this->getDate()->format('Y'));
>>> $this->setMonth($this->getDate()->format('m'));
>>> }
>>> 
>>> Then using the f:groupedFor [1] you can easily group your objects first
>>> with the year and then month by nesting f:groupedFor
>>> 
>>> Thanks,
>>> Pankaj
>>> 
>>> [1]
>>> http://api.typo3.org/typo3v4/current/html/class_tx___fluid___view_helpers___grouped_for_view_helper.html

Hi

Pankaj,

thank 
>>> 
>> you for your solution. I have been thinking about this, but didn't want 
>> to clutter my model with stuff that's allready there. Since I haven't 
>> found another way to do this, I might go for this anyaways.
>> 
>> Thanks again for sharing.
>> 
>> Henjo
>> 
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc

Looks great. Thanks.

Henjo



More information about the TYPO3-project-typo3v4mvc mailing list