Foren
Embed article with Freemarker
Jakub Bebjak, geändert vor 8 Jahren.
Embed article with Freemarker
Junior Member Beiträge: 25 Beitrittsdatum: 16.01.14 Neueste Beiträge
Hello,
Im trying embed article by id to footer section in theme based on Freemarker.
In Velocity I was using this code:
I rewrite it to Freemarker:
But I got error: "javax.servlet.jsp.JspException: freemarker.core.NonNumericalException: Error on line 11, column 6 in nextone-theme_SERVLET_CONTEXT_/templates/init_custom.ftl Expression theme_settings.footer is not numerical Expression section is not numerical"
Would anyone help me on this, thank you...
Im trying embed article by id to footer section in theme based on Freemarker.
In Velocity I was using this code:
#if ($theme_settings.footer-section-article-id)
#set ($footer_section = $journalContentUtil.getContent($group_id, $theme_settings.footer-section-article-id, null, "$locale", $theme_display))
#end
I rewrite it to Freemarker:
<#if theme_settings.footer-section-article-id>
<#assign footer_section = journalContentUtil.getContent(group_id, theme_settings.footer-section-article-id, null, "locale", theme_display)>
<!--#if-->
But I got error: "javax.servlet.jsp.JspException: freemarker.core.NonNumericalException: Error on line 11, column 6 in nextone-theme_SERVLET_CONTEXT_/templates/init_custom.ftl Expression theme_settings.footer is not numerical Expression section is not numerical"
Would anyone help me on this, thank you...
Jakub Bebjak, geändert vor 8 Jahren.
RE: Embed article with Freemarker
Junior Member Beiträge: 25 Beitrittsdatum: 16.01.14 Neueste Beiträge
I found a sollution
<#if theme.getSetting("footer-section-article-id")?has_content>
<#assign footer_section = journalContentUtil.getContent(group_id?long, theme.getSetting("footer-section-article-id"), "", "${locale}", theme_display)>
<!--#if-->
James Falkner, geändert vor 8 Jahren.
RE: Embed article with Freemarker
Liferay Legend Beiträge: 1399 Beitrittsdatum: 17.09.10 Neueste BeiträgeJakub Bebjak:
I found a sollution<#if theme.getSetting("footer-section-article-id")?has_content> <#assign footer_section = journalContentUtil.getContent(group_id?long, theme.getSetting("footer-section-article-id"), "", "${locale}", theme_display)> <!--#if-->
Yep you cannot mention the - (minus) character in Freemarker symbols - it's interpreted as a mathematical subtraction
You also could have used theme_settings['footer-section-article-id']