Bernhard, Dorner wrote:

> in a JSP I need the Content of a parent page. Before 4.5.x the following Code 
> did the job:
> 
> 
> Content current = MgnlContext.getAggregationState().getCurrentContent();
> paragraphList = 
> ContentUtil.getOrCreateContent([b]current.getParent()[/b],paragraphListName, 
> ItemType.CONTENTNODE, true);
> 
> With 4.5.x there a some changes. Unfortunately I was not able the change my 
> code to work again. Getting the content of the parent page is the problem. 
> With the following code I'm on the level of the parent page, but the node 
> itself is not the content node and I have no idea how to get "right content".
> 
> 
>  AggregationState aggState = MgnlContext.getAggregationState();
>  Content current = aggState.getCurrentContent();
>  Content parent = current.getParent().getParent().getParent();
>  paragraphList = ContentUtil.getOrCreateContent(parent, paragraphListName, 
> ItemType.CONTENTNODE, true);
> 
> Grateful for each help.

The node types have changed in Magnolia 4.5.

Before 4.5:

* Page: mgnl:content
* Paragraph: mgnl:contentNode

Since 4.5:

* Page: mgnl:page (MgnlNodeType.NT_PAGE)
* Area: mgnl:area (MgnlNodeType.NT_AREA)
* Component: mgnl:component (MgnlNodeType.NT_COMPONENT)

I'd also recommend rewriting your code to use the new Node API instead of the 
old Content API, so use SessionUtil.getNode, etc.

To learn more about the changes with Magnolia 4.5 see the documentation here: 
http://documentation.magnolia-cms.com/display/DOCS45/Migrating

Nils.

----------------------------------------------------------------
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: <[email protected]>
----------------------------------------------------------------

Reply via email to