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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Search content of a single space in confluence

How to search content of a single space in confluence that uses zen foundation theme

2 answers

1 accepted

0 votes
Answer accepted

you could create your own search box, either using the HTML macro or if you want to make it a little more usable, a user macro. you then just drop in {search-current-space} in the page.

## Macro title: Search Current Space
## Macro Name: search-current-space
## Macro has a body: N
## Body processing: No Macro Body
## Output: HTML
##
## Developed by: Matthew Cobby
## Date created: 26/07/2011
## Installed by: Matthew Cobby

<form method="POST" action="/dosearchsite.action" name="searchForm" style="padding: 1px; margin: 1px">
<input type="hidden" name="quickSearch" value="true" />
<input type="hidden" name="searchQuery.spaceKey" value="$space.getKey()" />
<input type="text" accessKey="s" name="searchQuery.queryString" size="50"/>
<input type="submit" value="Search Space"/>
</form>

what you are trying to do is create an HTML form in the page like this:

<form method="POST" action="/dosearchsite.action" name="searchForm" style="padding: 1px; margin: 1px">
<input type="hidden" name="quickSearch" value="true" />
<input type="hidden" name="searchQuery.spaceKey" value="**SPACEKEY OF CURRENT SPACE**" />
<input type="text" accessKey="s" name="searchQuery.queryString" size="25"/>
<input type="submit" value="Search Space"/>
</form>

if you wanted, you could add extra parameters to the macro to search types of content, date ranges, formatting rules etc

Deleted user Jan 24, 2013

That's true and yours is a much cooler solution, Matthew. But can OnDemand users create their own macros (or install their own plugins)?

ahh, my bad. I thought they now allowed some user macros but obviously not, it's still a restricted function. However, if you use the documentation theme, there is an option to restrict the search box in the top right to the default space

https://confluence.atlassian.com/display/AOD/Searching+Confluence#SearchingConfluence-SearchOptionsWhenUsingtheDocumentationTheme

You can then do it on a space by space basis.

0 votes
Deleted user Jan 24, 2013

You could reate a 'Search this space' landing page and add a search box macro to the page

Note, I don't know if the macros still exist in 4.x -- but that's how I would do it in 3.5x

Update: Sorry, I should have said a "Page Tree Search" macro. You have to specify the home page.

the only problem is that it misses out a lot of content, it won't search anything not under the home page, or other content like blog posts

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence Cloud

Please tell us how you use Confluence space settings

👋 Hi there, a few of us at Atlassian would love to learn about how you use "space settings" functionality in Confluence. A facelift to the space settings is long overdue and we want to start with im...

125 views 5 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you