Forum Discussion
As far as freemarker is concerned, the value you're getting back is a string. So if you want to use it as a number, you need to convert it. There's a "number" built-in that can be used with strings. For example:
<#assign global_blogsCount = rest('boards/style/blog/nested/count').value?number />
In case you're curious, you can find a full listing of the available freemarker built-ins here:
http://freemarker.sourceforge.net/docs/ref_builtins.html
I hope this helps!
-Adam
Thanks Adam,
That worked out the issue. Could you please point out what's wrong on this snippet?
<#if (global_blogsCount % 2) == 1)>
<#assign leftColumnEnd = (leftColumnEnd?int) + 1 />
<#/if>
<#list global_blogs.board?sort_by("title") as blog>
<#if gblogIdx != 0>
<#if (gblogIdx == (leftColumnEnd + 1) >
<#assign blogMenuContentAlpha = blogMenuContentAlpha + '</div><div class="hp-sub-nav-row blog-list-right">' />
<#/if>
</#if>
<#assign blogMenuContentAlpha = blogMenuContentAlpha + '<div class="hp-nav-col"><ul><li><a href="${blog.@view_href}">${blog.title}</a></li></ul></div>' /> <#assign gblogIdx = gblogIdx + 1 />
</#list>
Lines in bold are breaking my code
Gracias,
Luis
Related Content
- 5 months ago
- 3 years ago
- 2 years ago
- 2 years ago
- 2 years ago