Ignore:
Timestamp:
2012-08-09T17:20:51+12:00 (12 years ago)
Author:
ak19
Message:

Finally properly fixed the appearance and non-appearance of the quick search form. It should not appear if there are no query elements in the config file. However, even when no search indexes were built, query elements still came through in the XML and it was hard to distinguish at the XSLT stage whether any search indexes were built or not. Kathy suggested that the perl code writing out the buildconfig.xml should not write out the ServiceRacks for searching if no indexes were built and pointed out that the changes were required in buildconfigxml.pm which was called from basebuilder.pm to write out the buildConfig.xml file. Now the XSLT can at last do the right thing: it doesn't display the quick search area if there are no search elements, and doesn't provide the plain text query form in the quick search area if TextQuery isn't one of the query types, but does provide the buttons to other query types like form search if these are meant to be visible according to the SearchType format feature. If there are no search indexes built, then there is no quick search area.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl

    r26084 r26094  
    360360         no search indexes, which is why the extra test for the presence of an index/fq-something is necessary. -->
    361361    <xsl:template name="quick-search-area">
    362         <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']/paramList/param[@name='index' or starts-with(@name, 'fq')]">
     362        <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
    363363            <xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
    364364            <div id="quicksearcharea">
     365                <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
    365366                <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
    366367                    <!-- This parameter says that we have come from the quick search area -->
     
    423424                    <br/>
    424425                    </xsl:if>
     426                </form>
     427                </xsl:if>
     428               
    425429                    <!-- The list of other search types -->
    426430                    <ul>
     
    436440                        </xsl:for-each>
    437441                    </ul>
    438                 </form>
    439442            </div>
    440443        </xsl:if>
Note: See TracChangeset for help on using the changeset viewer.