Změny dokumentu Macro - changedpages1 - forTest
Naposledy upravil David Brazda 28.04.2021 07:58
Popis verze:
Nahrát nový obrázek logoPgWiki.jpg
Přehled
-
Na stránce změněno: (1 změněno, 0 přidáno, 0 odstraněno)
-
Attachments (0 změněno, 3 přidáno, 0 odstraněno)
-
Objects (1 změněno, 0 přidáno, 0 odstraněno)
Rozpis
- Na stránce změněno:
-
- Obsah
-
... ... @@ -2,5 +2,4 @@ 2 2 3 3 **for test just on this wiki** 4 4 5 -{{changedpages1/}} 6 - 5 +{{changedpages1 limit="10"/}}
- brevnov_int_podkroví_smer_bok.jpg
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.DavidBrazda - Size
-
... ... @@ -1,0 +1,1 @@ 1 +3.8 MB - Content
- ctvrecec v2_2 pgdenik.jpg
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.DavidBrazda - Size
-
... ... @@ -1,0 +1,1 @@ 1 +22.3 KB - Content
- logoPgWiki.jpg
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.DavidBrazda - Size
-
... ... @@ -1,0 +1,1 @@ 1 +15.8 KB - Content
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,7 +1,10 @@ 1 1 {{velocity}} 2 2 ##fetches last 6 created pages in 30days 3 3 #set($howManyDays = 30) 4 -#set($limit = 5) 4 +#set($limit = $xcontext.macro.params.get('limit')) 5 +#if (!$limit) 6 + #set($limit = 5) 7 +#end 5 5 #set($fromDate = $datetool.systemCalendar) 6 6 #set($discard = $fromDate.add(7,-$howManyDays)) 7 7 #set ($list = $services.query.xwql('where doc.creationDate > :date and doc.hidden = 0 order by doc.creationDate desc').bindValue('date', $datetool.toDate($fromDate)).setLimit($limit).execute()) ... ... @@ -13,9 +13,18 @@ 13 13 Nově vytvořené stránky 14 14 #foreach($reference in $list) 15 15 #set ($document = $xwiki.getDocument($reference)) 19 + #set ($xdom = $document.getXDOM()) 20 + ##find first paragraph 21 + #set ($block = $xdom.getFirstBlock('class:ParagraphBlock','DESCENDANT').filter('class:ImageBlock')) 22 + 23 + ##render it 24 + #set ($firstParagraph = $services.rendering.render($block, "xwiki/2.1")) 16 16 #if (!$document.isHidden() && ($document.getTitle())) 17 17 #set ($label = $document.getTitle()) 18 18 * [[$label>>$document]] 28 + #if ($firstParagraph) 29 + $firstParagraph 30 + #end 19 19 #end 20 20 #end 21 21 #end