Last modified by superadmin on 2026/12/02 07:12

From version Icon 5.1 Icon
edited by superadmin
on 2026/12/02 05:36
Change comment: There is no comment for this version
To version Icon 4.1 Icon
edited by superadmin
on 2026/12/02 00:14
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Syntax
... ... @@ -1,1 +1,1 @@
1 -XWiki 2.1
1 +XWiki 1.0
Content
... ... @@ -1,6 +1,4 @@
1 -{{include reference="Blog.BlogParameters" author="target" /}}
2 -
3 -{{velocity output="false"}}
1 +#includeMacros("Blog.BlogParameters")
4 4  ##
5 5  ##
6 6  ##
... ... @@ -106,12 +106,7 @@
106 106   * @param title The resulting title.
107 107   *###
108 108  #macro(getBlogTitle $blogDoc $title)
109 - ## The blog title is the rendered document title. It is displayed as data (never evaluated as
110 - ## Velocity), so an unprivileged user storing script in Blog.BlogClass.title cannot run it. See
111 - ## Blog.BlogSheet, which renders the title literally and falls back to the blog.code.title
112 - ## translation when the stored title is empty.
113 - #set ($title = $NULL)
114 - #setVariable ("$title" $!blogDoc.displayTitle)
107 + #getBlogProperty($blogDoc 'title' $!blogDoc.displayTitle $title)
115 115  #end
116 116  ##
117 117  ##
... ... @@ -124,9 +124,7 @@
124 124   * @param description The resulting description.
125 125   *###
126 126  #macro(getBlogDescription $blogDoc $description)
127 - #getBlogProperty($blogDoc 'description' '' $result)
128 - #set ($description = $NULL)
129 - #setVariable ("$description" $result)
120 + #getBlogProperty($blogDoc 'description' '' $description)
130 130  #end
131 131  ##
132 132  ##
... ... @@ -352,9 +352,7 @@
352 352   * @param displayType The resulting string. If the blog object does not define anything, it is considered paginated.
353 353   *###
354 354  #macro(getBlogDisplayType $blogDoc $displayType)
355 - #getBlogProperty($blogDoc 'displayType' 'paginated' $result)
356 - #set ($displayType = $NULL)
357 - #setVariable ("$displayType" $result)
346 + #getBlogProperty($blogDoc 'displayType' 'paginated' $displayType)
358 358  #end
359 359  ##
360 360  ##
... ... @@ -846,12 +846,10 @@
846 846   * @param propertyValue The resulting value.
847 847   *###
848 848  #macro(getBlogProperty $blogDoc $propertyName $defaultValue $propertyValue)
849 - #set($result = "$!{blogDoc.getObject(${blogClassname}).getProperty($propertyName).value}")
850 - #if($result == '')
851 - #set($result = $defaultValue)
838 + #set($propertyValue = "$!{blogDoc.getObject(${blogClassname}).getProperty($propertyName).value}")
839 + #if($propertyValue == '')
840 + #set($propertyValue = $defaultValue)
852 852   #end
853 - #set ($propertyValue = $NULL)
854 - #setVariable ("$propertyValue" $result)
855 855  #end
856 856  ## Compatibility helpers from the installed Blog 9.15.15 package.
857 857  #macro(bindQueryParameters $queryObj $queryParams)
... ... @@ -1041,5 +1041,3 @@
1041 1041   #setVariable("$isDefault" $result)
1042 1042  #end
1043 1043  
1044 -{{/velocity}}
1045 -

#includeMacros("Blog.BlogCode")
#getBlogEntriesBaseQuery($query)
#set($query = "$!{query} and isPublished.value = 1")
#set($recentEntries = $xwiki.searchDocuments("${query} order by publishDate.value desc", 10, 0))
#if($recentEntries.size() > 0 || $showEmptyPanels)
  #panelheader('Recent Blog Posts')
  #foreach($entryDoc in $xwiki.wrapDocs($recentEntries))
    #getEntryObject($entryDoc $entryObj)

  • [$!{entryDoc.display('title', 'view', $entryObj)}>$!{entryDoc.fullName}]
      #end
      #panelfooter()
    #end

#includeMacros("Blog.BlogCode")
#getBlogEntriesBaseQuery($query)
#set($query = "$!{query} and isPublished.value = 0")
#set($unpublishedEntries = $xwiki.searchDocuments("${query} order by publishDate.value desc", 5, 0))
#if($unpublishedEntries.size() > 0 || $showEmptyPanels)
  #panelheader("Unpublished Posts")
  #foreach($entryDoc in $xwiki.wrapDocs($unpublishedEntries))
    #getEntryObject($entryDoc $entryObj)

  • [$!{entryDoc.display('title', 'view', $entryObj)}>$!{entryDoc.fullName}]
      #end
      [View all ($xwiki.countDocuments($query))>Blog.Unpublished]
      #panelfooter()
    #end

#includeMacros("Blog.CategoriesCode")
#panelheader('Blog Categories')
#getCategoriesHierarchy('Blog' $tree)
#displayCategoriesHierarchy($tree 'simple')
#if($xwiki.hasAdminRights())
  <div style="font-size:75%;">(<a href="$xwiki.getURL('Blog.ManageCategories')">Edit Categories</a>)</div>
#end
#panelfooter()

{{include reference="Blog.BlogCode"/}}

{{velocity}} #getAllBlogPostsQueryBasedOnDisplayContext($doc $query $queryParams) #bindQueryParameters($queryObj $queryParams) {{/velocity}}