Magnolia Node Types

Magnolia Node Types

Since I always have to look up which node type I’m looking for, I wrote this post hoping that this information now will remain in my memory 😀

Most of the times you can either filter by using a String like mgnl:content or the static fields of the class info.magnolia.cms.core.ItemType like ItemType.CONTENT.

Sometimes you also have to wrap the type with a info.magnolia.cms.util.NodeTypeFilter for example when using info.magnolia.cms.util.ContentUtil#visit.

                ContentUtil.visit(content, new ContentUtil.Visitor() {
                    public void visit(Content node) throws Exception {
                        //To change body of implemented methods use File | Settings | File Templates.
                }, new NodeTypeFilter(ItemType.CONTENT));

Or when writing a Task and you’are extending from info.magnolia.module.templatingkit.setup.VisitAllChildrenOperation.

For more information about all the different node types there exist check this link.