Can I change the words "Search Confluence" in the Confluence search field?

Can I change the words "Search Confluence" in the Confluence search field?

4 answers

1 accepted

Sandro has answered this question in my unintentional similar posting:

https://answers.atlassian.com/questions/20506/change-the-default-text-in-the-search-box.

We did that in Confluence 4 with some JavaScript in Browse => Confluence Admin => Look and Feel => Custom HTML:

<script>
AJS.toInit(function ($) {
    AJS.applySearchPlaceholders = function (scope) {
        var CUSTOM_PLACEHOLDER = "YOUR PLACEHOLDER";

        $searchBox = $("#quick-search-query");
		$searchBox.attr("placeholder", CUSTOM_PLACEHOLDER);
		$searchBox.closest("form").find("input[type='submit']").val(CUSTOM_PLACEHOLDER);

        $searchBox.data("quicksearch", {
            placeholder: $searchBox.attr("placeholder") || $searchBox.closest("form").find("input[type='submit']").val(),
            placeholded: true
        });

        if (!$.browser.safari) {
            $searchBox.val($searchBox.data("quicksearch").placeholder);
            $searchBox.addClass("placeholded");

            $searchBox.focus(function () {
                var $this = $(this);
                if ($this.data("quicksearch").placeholded) {
                    $this.data("quicksearch").placeholded = false;
                    $this.val("");
                    $this.removeClass("placeholded");
                }
            });

            $searchBox.blur(function () {
                var $this = $(this);
                if ($this.data("quicksearch").placeholder && (/^\s*$/).test($this.val())) {
                    $this.val($this.data("quicksearch").placeholder);
                    $this.data("quicksearch").placeholded = true;
                    $this.addClass("placeholded");
                }
            });
        } else {
            $searchBox.type = "search";
            $searchBox.attr("results", 10);
            $searchBox.attr("placeholder", $searchBox.data("quicksearch").placeholder);
            $searchBox.val("");
        }
    };
    AJS.applySearchPlaceholders();
});
</script>

Dont't forget to replace "YOUR PLACEHOLDER" with the text you want to display.

PS: Please stop asking the same question over and over again.

For Doc Theme specificially, you can change this by modifying the following in confluence-install/confluence/WEB-INF/classes/com/atlassian/confluence/setup/atlassian-bundled-plugins.zip/doctheme-x.x.x.jar/doctheme/i18n.properties:

doctheme.global.search.name = Search Confluence

For more details on how to edit files within JAR archives, please refer to this page.

For other themes that inherits from the default one, you can modify this particular line using this method:

quick.search.submit=Search
0 vote
David Simpson Community Champion Oct 28, 2011
This should Be straightforward with a bit of JavaScript, or you could create a partial language pack to do the same job.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi 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...

2,933 views 27 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you