Adding a model class to a page template

View: New views
4 Messages — Rating Filter:   Alert me  

Adding a model class to a page template

by Nicolas Brasseur :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Hi there,

I am trying to add a model class to a page template but it does not work.
I have successfully done that with a paragraph but can't make it work for a page.
Is there any special operation do to beside adding the modelClass node ?

Nicolas



     

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <user-list-unsubscribe@...>
----------------------------------------------------------------


Re: Adding a model class to a page template

by gregoryjoseph :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Jun 22, 2009, at 12:51 PM, Nicolas Brasseur wrote:

>
>
> Hi there,
>
> I am trying to add a model class to a page template but it does not  
> work.

Can you elaborate ?

> I have successfully done that with a paragraph but can't make it  
> work for a page.
> Is there any special operation do to beside adding the modelClass  
> node ?
>
> Nicolas
>
>
>
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <user-list-unsubscribe@...>
> ----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <user-list-unsubscribe@...>
----------------------------------------------------------------


Re: Adding a model class to a page template

by Nicolas Brasseur :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Sure,

In summary I try to build a todo system for my pages. I want to the todos to be at the paragraph level, and I also want to be able to have several todo per paragraphs.
So, I have several pages composed of several text-paragraphs, each text-paragraphs may have several todos.
I try to build a new page that displays a table containing all the the todos for all the pages:
- I've build a template definition for my page in admin central
- I've written a Model Class to prepare a collection of todo paragraphs to display
- I've build a .ftl page to display the collection

it seems that my model class is never executed ... is there something different to do when you build a model class for a page (vs. for a paragraph)?

Nicolas



----- Original Message ----
From: Grégory Joseph <gregory.joseph@...>
To: Magnolia User-List <user-list@...>
Sent: Monday, June 22, 2009 2:19:14 PM
Subject: Re: [magnolia-user]  Adding a model class to a page template



On Jun 22, 2009, at 12:51 PM, Nicolas Brasseur wrote:

>
>
> Hi there,
>
> I am trying to add a model class to a page template but it does not work.

Can you elaborate ?

> I have successfully done that with a paragraph but can't make it work for a page.
> Is there any special operation do to beside adding the modelClass node ?
>
> Nicolas
>
>
>
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <user-list-unsubscribe@...>
> ----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <user-list-unsubscribe@...>
----------------------------------------------------------------




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <user-list-unsubscribe@...>
----------------------------------------------------------------


Re: Adding a model class to a page template

by gregoryjoseph :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Jun 22, 2009, at 2:33 PM, Nicolas Brasseur wrote:

>
>
> Sure,
>
> In summary I try to build a todo system for my pages. I want to the  
> todos to be at the paragraph level, and I also want to be able to  
> have several todo per paragraphs.
> So, I have several pages composed of several text-paragraphs, each  
> text-paragraphs may have several todos.
> I try to build a new page that displays a table containing all the  
> the todos for all the pages:
> - I've build a template definition for my page in admin central
> - I've written a Model Class to prepare a collection of todo  
> paragraphs to display
> - I've build a .ftl page to display the collection

I meant elaborate on what doesn't work ;)

> it seems that my model class is never executed ... is there  
> something different to do when you build a model class for a page  
> (vs. for a paragraph)?

No, there should be no difference; if your ftl uses the model, though,  
you should probably see errors in there, if the model class wasn't used.
You could also try plugging your debugger in  
info.magnolia.module.templating.AbstractRenderer, which is where your  
model should be executed.

Cheers,

-g

> ----- Original Message ----
> From: Grégory Joseph <gregory.joseph@...>
> To: Magnolia User-List <user-list@...>
> Sent: Monday, June 22, 2009 2:19:14 PM
> Subject: Re: [magnolia-user]  Adding a model class to a page template
>
>
>
> On Jun 22, 2009, at 12:51 PM, Nicolas Brasseur wrote:
>
>>
>>
>> Hi there,
>>
>> I am trying to add a model class to a page template but it does not  
>> work.
>
> Can you elaborate ?
>
>> I have successfully done that with a paragraph but can't make it  
>> work for a page.
>> Is there any special operation do to beside adding the modelClass  
>> node ?
>>
>> Nicolas
>>
>>
>>
>>
>>
>> ----------------------------------------------------------------
>> For list details see
>> http://www.magnolia-cms.com/home/community/mailing-lists.html
>> To unsubscribe, E-mail to: <user-list-unsubscribe@...>
>> ----------------------------------------------------------------
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <user-list-unsubscribe@...>
> ----------------------------------------------------------------
>
>
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <user-list-unsubscribe@...>
> ----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <user-list-unsubscribe@...>
----------------------------------------------------------------