Изменения документа HRlink. Новости об обновлениях
Редактировал(а) HRlink 22.08.2025
Сводка
-
Свойства страницы (1 изменено, 0 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Содержимое
-
... ... @@ -1,27 +1,23 @@ 1 1 {{velocity}} 2 -#set($full = $doc.fullName) 3 -#if($full.endsWith('.WebHome')) 4 - #set($prefix = $full.substring(0, $full.length() - 8) + '.') 5 -#else 6 - #set($prefix = $full + '.') 7 -#end 2 +#set($category = "Blog.HRlink.-Novosti-ob-obnovleniiakh-.WebHome") 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()) 8 8 9 -#set($rows = $services.query.xwql( 10 - "select doc.fullName from Document doc " + 11 - "where doc.fullName like :pref and doc.name <> 'WebHome' " + 12 - "order by doc.date desc" 13 -).bindValue('pref', $prefix + '%').setLimit(50).execute()) 14 - 15 -#if($rows.isEmpty()) 16 - <p>Пока нет публикаций в этой ветке.</p> 6 +#if($results.isEmpty()) 7 + <p>Нет постов в данной категории.</p> 17 17 #else 18 - #foreach($fn in $rows) 19 - #set($d = $xwiki.getDocument($fn)) 20 - <article style="margin:14px 0; padding-bottom:10px; border-bottom:1px solid #e5e7eb"> 21 - <div style="color:#6b7280; font-size:.9em">$datetool.format('dd MMM yyyy', $d.date)</div> 22 - <h3 style="margin:.2rem 0"><a href="$d.getURL('view')">$escapetool.html($d.displayTitle)</a></h3> 23 - <div>$!d.getPlainContent().substring(0,300)…</div> 24 - </article> 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> 25 25 #end 26 26 #end 27 27 {{/velocity}}