Изменения документа HRlink. Новости об обновлениях
Редактировал(а) HRlink 22.08.2025
Сводка
-
Свойства страницы (1 изменено, 0 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Содержимое
-
... ... @@ -1,10 +1,23 @@ 1 1 {{velocity}} 2 2 #set($category = "Blog.HRlink.-Novosti-ob-obnovleniiakh-.WebHome") 3 -#set($query = " , BaseObject as obj, StringProperty as cat where obj.name=doc.fullName andobj.className= 'Blog.BlogPostClass'andcat.id.id=obj.id and cat.name = 'category'and cat.value= :category order bydoc.creationDate desc")4 -#set($results = $services.query. hql($query).bindValue('category', $category).setLimit(15).execute())3 +#set($query = "from doc.object(Blog.BlogPostClass) as post where post.category = :category order by post.publishDate desc") 4 +#set($results = $services.query.xwql($query).bindValue('category', $category).setLimit(20).execute()) 5 5 6 -#foreach($docName in $results) 7 - #set($doc = $xwiki.getDocument($docName)) 8 - #displayBlogPost($doc) 6 +#if($results.isEmpty()) 7 + <p>Нет постов в данной категории.</p> 8 +#else 9 + #foreach($docName in $results) 10 + #set($doc = $xwiki.getDocument($docName)) 11 + #set($post = $doc.getObject('Blog.BlogPostClass')) 12 + 13 + <div class="blog-post"> 14 + <h2><a href="$doc.getURL()">$!post.getProperty('title').value</a></h2> 15 + <p class="date">Опубликовано: $!datetool.format('dd.MM.yyyy', $post.getProperty('publishDate').value)</p> 16 + #if($post.getProperty('summary').value) 17 + <div class="summary">$!post.getProperty('summary').value</div> 18 + #end 19 + <a href="$doc.getURL()">Читать далее →</a> 20 + </div> 21 + #end 9 9 #end 10 10 {{/velocity}}