Content by Label |
---|
showLabels | false |
---|
max | 30 |
---|
spaces | SUP,GRIB,MAGP,METV,ECFLOW,MARSAD,ECAC |
---|
sort | creation |
---|
reverse | true |
---|
labels | news |
---|
|
Wiki Markup | {jython}
from com.atlassian.confluence.search.v2 import ContentSearch
from com.atlassian.confluence.search.v2.query import LabelQuery
# Careful!! GeneralUtil.getRelativeTime is deprecated
from com.atlassian.confluence.util import GeneralUtil
query = LabelQuery("news")
search = ContentSearch(query,None,None,None)
results = searchManager.search(search)
alist = []
for i in results:
alist.append(i)
alist.reverse()
out.print("<div class='recently-updated recently-updated-concise'><h4 class='sub-heading'>Latest News</h4><div class='results-container'><ul>")
for i in alist:
out.print("""
<li class='update-item'>
<div class='icon-container'><a href=\"%s%s\">%s</a></div>
<div class='update-item-desc'>from <a href='/wiki/display/%s'>%s</a></div>
<div class='update-item-date'>%s</div>
</li>""" % (contextPath,i.urlPath,i.displayTitle, i.spaceKey,i.spaceName,GeneralUtil.getRelativeTime(i.lastModificationDate)))
out.print("</ul></div></div>")
{jython} |