From 9b2aacc26db5edb6825655d9947c84129638b655 Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Wed, 4 Sep 2024 17:34:00 +0200 Subject: [PATCH] #219 add short code template function to template rendering process --- .../github/thmarx/cms/content/DefaultContentRenderer.java | 6 ++++++ distribution/build.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cms-content/src/main/java/com/github/thmarx/cms/content/DefaultContentRenderer.java b/cms-content/src/main/java/com/github/thmarx/cms/content/DefaultContentRenderer.java index ec6634f9..10f2e638 100644 --- a/cms-content/src/main/java/com/github/thmarx/cms/content/DefaultContentRenderer.java +++ b/cms-content/src/main/java/com/github/thmarx/cms/content/DefaultContentRenderer.java @@ -53,6 +53,7 @@ import com.github.thmarx.cms.content.template.functions.list.NodeListFunctionBuilder; import com.github.thmarx.cms.content.template.functions.navigation.NavigationFunction; import com.github.thmarx.cms.content.template.functions.query.QueryFunction; +import com.github.thmarx.cms.content.template.functions.shortcode.ShortCodeTemplateFunction; import com.github.thmarx.cms.content.template.functions.taxonomy.TaxonomyFunction; import com.github.thmarx.modules.api.ModuleManager; import java.io.IOException; @@ -169,6 +170,7 @@ public String render(final ReadOnlyFile contentFile, final RequestContext contex ); model.values.put("sections", sections); + model.values.put("shortCodes", createShortCodeFunction(context)); model.values.put("navigation", createNavigationFunction(contentFile, context)); model.values.put("nodeList", createNodeListFunction(contentFile, context)); model.values.put("query", createQueryFunction(contentFile, context)); @@ -285,4 +287,8 @@ public Map> renderSections(final List section return sections; } + private ShortCodeTemplateFunction createShortCodeFunction(RequestContext context) { + return new ShortCodeTemplateFunction(context.get(RenderContext.class).shortCodes()); + } + } diff --git a/distribution/build.xml b/distribution/build.xml index ac857fdb..c44a2572 100644 --- a/distribution/build.xml +++ b/distribution/build.xml @@ -1,6 +1,6 @@ - 5.2.0 + 5.3.0 v1.2.0