The macro sets parameters for the search term, result limit, and sorting order. It constructs a CQL query to find relevant content and executes it against the Confluence API. The results are displayed as a list.
#set($searchTerm = $parameters.searchTerm)
#set($limit = 50)
#set($sortOrder = "created desc")
## Define CQL query
#set($cqlQuery = "type in (page, blogpost, attachment) AND text ~ '\'$searchTerm\'' order by $sortOrder")
## Execute the query with expanded version data
#set($response = $ConfluenceManager.get("/wiki/rest/api/content/search?cql=$cqlQuery&limit=$limit&expand=space,version"))
<ul>
<p style="margin-bottom: 10px;">
Search results for <strong>$searchTerm:</strong>
</p>
#if($response.results.size() > 0)
#foreach($content in $response.results)
<li style="list-style-type: top; margin-left: 30px;">
<span class="aui-lozenge aui-lozenge-subtle aui-lozenge-success">$content.type</span>
<a href="${response._links.base}$content._links.webui" target="_blank">$content.title</a>
in $content.space.name space
</li>
#end
#else
<li>No results found for "$searchTerm"</li>
#end
</ul>Display Jira issue comments in a table
Macro that will show a "Delete me" message only for editors (in the Page Edit mode)
Display information about how many users have access to each space
Add a floating scroll-to-top arrow button in pages. Always visible, lightweight, and improves navigation for long documents.
Macro for printing all the spaces
An overview of all pages within one space which contains the title, the version, and the last updated date
Shows H1 headings directly to children's topics for easy navigation.
Perform customized searches based on labels, content types, and other parameters.
Space Information macro by space Id
Macro for generating ID in base32 format