quickSearch template for documentation theme

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?

1 answer

1 accepted

0 votes
Accepted answer

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


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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,081 views 17 14
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