tagbangers / wallride

multilingual easy-to-customize open source CMS made by Java
http://wallride.org/
Apache License 2.0
95 stars 80 forks source link

Add "articles" to Thymeleaf-AddtionalExpression. #41

Closed gino8070 closed 8 years ago

gino8070 commented 8 years ago

Add "articles" to Thymeleaf-AddtionalExpression.

Impl method byCategoryAndTagName. How to use from views.

<th:block th:unless="${#sets.isEmpty(page.getCategories())}">
<div th:each="newsArticles : ${#articles.byCategoryAndTagName(page.getCategories().first(), 'NEWS', 4)}">
<p th:text="${#posts.title(newsArticles)}"/>
</div>
</th:block>
gino8070 commented 8 years ago

Replace "articles" to "searches" from Thymeleaf-AddtionalExpression.

How to use from views.

<div th:each="newsArticles : ${#searches.articles(#searches.condition().tagNames('NEWS').categoryCodes(page.getCategories().first().getCode()).size(4))}">
    <p th:text="${#posts.title(newsArticles)}">aaa</p>
</div>