Degraded performance Customers may experience intermittent errors using Community search. Our platform vendor is investigating.
It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
I can't find any information online about customizing the Confluence search to exclude images and all other attachments. I know that users can set a filter on the advanced search page, but I'd like the default search to return only pages (no images, other attachments, blogs, etc.).
I'd appreciate any and all ideas.
Best,
Jesse
You can exclude attachments from being indexed. Here is the documentation for that.
https://confluence.atlassian.com/display/CONFKB/How+Do+I+Disable+Indexing+of+Attachments
Thanks, Davin. I've looked through that document before. It seems to be about excluding Word, PowerPoint, Excel, and PDF files, but I'm interested in excluding all images as well. Is that also possible by editing the atlassian-plugin.xml?
Do you want users to not ever be able to search for these, or just not by default using the top right search box? If you just want to make sure that the top right search bar will by default only show pages then you can add this Javascript to the global custom html. This will put in a hidden field in the form element of the top right search box that says to only return pages.
AJS.toInit(function(){ AJS.$('#quick-search').append('<input type="hidden" name="type" value="page">'); });
This is exactly what I was looking for. Thanks very much, Davin! It works perfectly for the global search.
I tried to apply this to the search box in the pagetree area (documentation theme) but didn't have any luck. Instead, I hid the default search box in the space stylesheet and configured the doc theme to include the {search-box} macro, which lets me filter by type.
David, I found a solution for filtering page tree search results. A bit of a hassle, but it works.
In each space, we did the following:
1. We configured the Documentation theme (Browse > Space Admin > Themes Configure them), adding a custom search macro to the page tree area. We also used the html macro to tag the search box with an html id, so that we can target it in the space styesheet.
{html}<div id="customsearchbox">{html} {search-box:space=console|type=page} {html}</div>{html} |
2. We editing the space stylesheet (Browse > Space Admin > Stylesheet) to hide the default search box and apply our styling to the custom search box:
/**************************************** Space-specific search box Default search box is hidden; custom is included in the doc theme *****************************************/ #pagetreesearch { display: none; } #customsearchbox { margin: 10px 0 10px 20px; min-width: 230px; } #customsearchbox form.confluence-searchbox.adaptavist-searchbox { white-space: nowrap; margin: 1.5em 0 0 0; position: relative; } #customsearchbox input[type=text], #customsearchbox input[type=submit] { margin: 0 8px 8px 0; border: 1px solid #CCCCCC; color: #666666; max-width: 165px; padding: 4px 5px; height: 2.14285em; line-height: 1.4285; box-shadow: inset 0 1px 3px #CCC; width: 100%; border-radius: 3.01px; font-size: inherit; font-family: 'Open Sans', Arial, sans-serif; box-sizing: border-box; } #customsearchbox input[type=submit]{ background: #f2f2f2; background: -moz-linear-gradient(top,#fff 0,#f2f2f2 100%); background: -ms-linear-gradient(top,#fff 0,#f2f2f2 100%); background: -o-linear-gradient(top,#fff 0,#f2f2f2 100%); background: -webkit-linear-gradient(top,#fff 0,#f2f2f2 100%); background: linear-gradient(top,#fff 0,#f2f2f2 100%); text-decoration: none; text-shadow: 0 1px 0 white; vertical-align: baseline; min-width: 0; width: auto; box-shadow: none; } |
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreHi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.