Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Creating HTML macro that will search in multiple defined wiki pages


I have a few wiki spaces and would like to create a search bar using the HTML macro that will allow me to search within only the few spaces I've defined. I'm not handy with HTML and would like some help with an HTML macro that will allow me to do this. I know the newer version of Confluence has this ability but my org will not update to a new version.

Thank you!

1 comment

Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 23, 2019

Here is sample you can use and start your work.

It contain a simple html form with text field, and when you submit this form search result page is opened.

There is array called 'SPACES_KEY' in which you can provide all spaces you want to search with this particular form.


<form id="space-search" method="GET">
<input type="text" name="query" id="search-query"/>
<input type="submit" value="Search" />
AJS.toInit(function () {
var SPACES_KEY = ['CM']; //list all space you want to search in this array
var $ = AJS.$;

$('#space-search').submit(function (e) {
var q = $('#search-query').val();
var query = 'siteSearch ~ "' + q + '" AND space in (' + SPACES_KEY.join(",") + ')';

window.location = 'dosearchsite.action?cql=' + encodeURI(query); //open new page with search results

return false;


This worked perfectly, thank you!


Log in or Sign up to comment
AUG Leaders

Atlassian Community Events