Page tree
Skip to end of metadata
Go to start of metadata

This page summarizes changes in the STK API in Magnolia CMS 4.5

Class replacements

Old

New

info.magnolia.module.templatingkit.templates.STKTemplate

info.magnolia.module.templatingkit.templates.pages.STKPage

info.magnolia.module.templating.ParagraphManager

info.magnolia.rendering.template.registry.TemplateDefinitionRegistry

info.magnolia.module.templating.TemplateManager

info.magnolia.rendering.template.registry.TemplateDefinitionRegistry

info.magnolia.module.templating.Paragraph

info.magnolia.rendering.template.TemplateDefinition

info.magnolia.module.templating.Templateinfo.magnolia.rendering.template.TemplateDefinition

Example usage

Task

Old

New

Imaging support

site.getTheme().getImaging()

stkfunctions.theme(site).getImaging()

Filter children of a content

hm.getContent("nodeName").getChildren(new ContentFilter()))

NodeUtil.asList(NodeUtil.getNodes(session.getNode("nodeName"),
new Predicate())

Get the site root in the model)

((STKTemplateModel)getRoot()).getSiteRoot();

(AbstractSTKTemplateModel) getSiteRoot();

Query Manager

MgnlContext.getQueryManager("website")
.createQuery(queryString, "sql");

Context.getJCRSession(RepositoryConstants.WEBSITE).getWorkspace().getQueryManager()
.createQuery(queryString, "sql");

Get CSS from a Model

getSite().getTheme().getCssFiles();

stkFunctions.theme(getSite()).getCssFiles()

Other things