Matej Šípka
Matej Šípka

Reputation: 190

Liferay theme template processing error

I'm learning how to develop a custom template for my portal. When I'm trying to use my template the following error is thrown:


10:10:44,752 ERROR [http-bio-80-exec-163][runtime:96] Template processing error: "Macro language_format has no such argument: objects"

Macro language_format has no such argument: objects
The problematic instruction:
----------
==> macro language_format [on line 63, column 1 in FTL_liferay.ftl]
 in user-directive liferay.language_format [on line 34, column 72 in theme-theme_SERVLET_CONTEXT_/templates/portal_normal.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Macro language_format has no such argument: objects
    at freemarker.core.Environment.visit(Environment.java:576)
    at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)

I found out that it's an issue and the problem is solved here: https://www.liferay.com/community/forums/-/message_boards/message/44180674

BUT there’s always BUT.... when I replace this line

<span class="site-name" title="<@liferay.language_format objects="${site_name}" key="go-to-x" />"> 

by this

<span class="site-name" title="<@liferay.language_format arguments="${site_name}" key="go-to-x" />">

I need to redeploy my theme. After that, portal_normal.ftl file is overwritten back to default code. And the same issue appears. Maybe it's a simple thing to solve, but it makes me furious. Thank you for your help.

Upvotes: 0

Views: 1199

Answers (1)

Olaf Kock
Olaf Kock

Reputation: 48067

You'll have to edit your template in docroot/_diffs/templates/portal_normal.ftl. The _diffs part is the important one.

Liferay's build process for themes copies the parent theme (see build.xml) to the output directory, then overwrites this with content from the _diffs folder. That's most likely why you loose your edits: If you edit in the output directory, the first of these steps will reverse your edits.

Upvotes: 2

Related Questions