quickSearch template for documentation theme
Asked by AlexH:

We replace the normal "macro(quickSearch)" template as defined in:

```
<confluence-install>/confluence/template/includes/macros.vm
```

With our own template that directs user search queries to a custom Google Search Appliance.

However, when we upgraded from 3.1.2 to 3.5.6 the new Documentation theme ignores the quickSearch template in the macros.vm file in favor of something else.

Can anyone tell me where the documentation theme is pulling its quickSearch template from?


Answers:
author: AlexH
body: With a little guidence from Atlassian Support I found out that the Documentation theme is actually a bundled plugin located in a jar (doctheme-1.9.jar) inside:

Confluence_install\\confluence\\WEB-INF\\classes\\com\\atlassian\\confluence\\setup\\atlassian-bundled-plugins.zip  

I ripped this jar apart and found main.vmd inside the jar at:

```
doctheme/decorators/main.vmd
```

I replaced the following section:

```
    <form id="quick-search" class="quick-search" method="get" action="$req.contextPath/dosearchsite.action">
        #if ($sitemeshPage.getProperty("page.spacekey") && $docThemeHelper.isSpaceSearchEnabled($spaceKey))
            <input type='hidden' name='where' value='$generalUtil.htmlEncode($sitemeshPage.getProperty("page.spacekey"))'/>
            <input type='hidden' name='tooltip' value='$action.getText('doctheme.search.tooltip')'/>
        #end
        <fieldset>
            <input type="hidden" name="spaceSearch" value="$docThemeHelper.isSpaceSearchEnabled($spaceKey)"/>
        </fieldset>
        <fieldset>
            <legend>$action.getText('quick.search.legend')</legend>
            <input class="quick-search-query" id="quick-search-query" type="text" accessKey="$action.getTextStrict('search-pages-action.accesskey')" autocomplete="off" name="queryString" size="25"/>
            <input class="quick-search-submit" id="quick-search-submit" type="submit" #if ( ($spaceKey) && $docThemeHelper.isSpaceSearchEnabled($spaceKey)) value="$action.getText('doctheme.space.search.name')" #else value="$action.getText('doctheme.global.search.name')" #end/>
            <div class="aui-dd-parent quick-nav-drop-down"><!-- Quick nav appears here --></div>
        </fieldset>
        <fieldset class="hidden parameters">
            <input type="hidden" id="quickNavEnabled" value="$!settingsManager.globalSettings.enableQuickNav" />
            #if (!$settingsManager) <!-- Quick nav disabled. SettingsManager could not be found --> #end
        </fieldset>
    </form>
```

With our customized search form:

\<form id="quick-search" class="quick-search" method="get" action="http://gsa.company.net/search"\>  
\<fieldset\>  
\<input type="text" value="" maxlength="255" size="25" name="q"/\>  
\<input type="hidden" value="wiki" name="site"/\>  
\<input type="hidden" value="wiki_fe" name="client"/\>  
\<input type="hidden" value="wiki_fe" name="proxystylesheet"/\>  
\<input type="hidden" value="xml_no_dtd" name="output"/\>  
\</fieldset\>  
\</form

<br />

Then I rejar'd the files and uploaded/installed a new version of the doctheme plugin (doctheme-1.9-gsa.jar) via the UPM interface.

Clearly this means I've signed up to re-customize the doctheme plugin everytime Atlassian releases updates, but at least search is once again consistent for us across all confluence themes.