[magnolia-user] Re: modelClass and public methods

2016-10-17 Thread Richard Gange (via Magnolia Forums)
Hi Tim-

Your investigation is correct. Any template can have a model class attached. So 
at the time of an area rendering the system will look to see if there was a 
model class defined on the area template. If so, it's executed, otherwise 
nothing. The system would not look for parent model to execute or something 
like that. 

So I see two possibilities. You can create an area model which exposes a public 
method for accessing the parent model. Or you pass the data into the area 
rendering through a context parameter. If it were me I'd use the latter.

Something like:
[code][@cms.area name="myArea" contextAttributes={"myData":model.data}][/code]

HTH
richg

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=1fe8e5ee-21c3-4921-9e98-aa26989537d9



For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: 




[magnolia-user] Re: modelClass and public methods

2016-09-25 Thread via Magnolia Forums
Hmmm
[code]public class RenderingModelImpl 
implements RenderingModel {
@Override
public RenderingModel getParent() {
return this.parentModel;
}
...
}[/code]

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=1fe8e5ee-21c3-4921-9e98-aa26989537d9



For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: 




[magnolia-user] Re: modelClass and public methods

2016-09-25 Thread via Magnolia Forums
i think i know what is "wrong". I set model class to page, but trying to access 
public methods in sub area. Area have it's own model and no execution happens. 
Is it possible to get access to parent model?

Put parent model to context it' not solution for me :)

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=1fe8e5ee-21c3-4921-9e98-aa26989537d9



For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: 




[magnolia-user] Re: modelClass and public methods

2016-09-23 Thread via Magnolia Forums
Strange in deep debug i see model equals to my, extended class. Why no method 
execution in ftl?

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=1fe8e5ee-21c3-4921-9e98-aa26989537d9



For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: