Helmut Winkelbach
Helmut Winkelbach

Reputation: 109

TYPO3 8.4 and tx_indexedsearch_pi2

indexed search does not fully return results from header search box. When I start a search there, it goes to the right page and takes the word searched into the search field of the search page, but does not search through it. If I then click on the side where the plugin lies on search, it gives me the results. Here is my TypoSrict: http://pastebin.com/yQ0UWdjn

my constants:

plugin.tx_indexedsearch {
view {
  templateRootPath = EXT:my_distribution/Resources/Private/Templates/
  partialRootPath = EXT:my_distribution/Resources/Private/Partials/
  layoutRootPath = EXT:my_distribution/Resources/Private/Layouts/
}
settings {
  targetPid = 11
  rootPidList = 1
  }
}

Templates, Partials, Layouts are copied from the Extension.

Upvotes: 0

Views: 1346

Answers (3)

Delmontee
Delmontee

Reputation: 2364

For anybody else still having trouble, here was my solution for V8.7.19 (hopefully compatible with v6 - v9)

First, pass in the pageUId of the search field. I did this in my template setup:

page.10.settings.searchTargetPid = 119  //This is my pid number

Next, in my own private templates folder I created a search form using the following html:

<f:form method="post" pageUid="{settings.searchTargetPid}" name="tx_indexedsearch" extensionName="indexedsearch" pluginName="pi2" action="search" controller="Search">
    <f:form.textfield name="search[sword]" value="{sword}" />
    <f:form.submit name="search[submitButton]" value="Search" id="tx-indexedsearch-searchbox-button-submit" />
</f:form>

Note the use of the form parameters:

  • extensionName="indexedsearch" - without this your search text won't be used
  • pluginName="pi2" - without this your search text won't be used
  • action="search" - without this you will get an error regarding the denial of use of the "Standard" action
  • controller="Search" - without this you will get an error regarding the denial of use of the "Standard" action

Upvotes: 1

Helmut Winkelbach
Helmut Winkelbach

Reputation: 109

Thanks Manthan for your help. Here is the final version:

        <div class="searchbox">
        <div class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown" title="Webseite durchsuchen..." aria-expanded="true"> <span class="glyphicon glyphicon-search"></span> </a>
            <div class="dropdown-menu" style="padding: 0 15px; min-width: 250px;">
            <f:form pageUid="{settings.indexedSearchResult}" action='search' extensionName="indexedsearch" controller='Search' pluginName='Pi2' id="headerSearchForm" style="width:100%;" class="navbar-form">
            <div class="input-group">
                <f:form.textfield class="form-control search" name="search[sword]" placeholder="Webseite durchsuchen..." />
        <span class="input-group-btn"> 
              <button class="btn btn-default" type="submit" name="submitButton"><span class="glyphicon glyphicon-search"></span></button> 
              </span> 
            </div>
            </f:form>
            </div>
        </div>        
    </div>

Upvotes: 0

Manthan Budheliya
Manthan Budheliya

Reputation: 91

For extbase indexed search you should rename your search form field's name property with the following example code and put it in fluid template instead of TypoScript.

<f:form pageUid="{settings.searchPage}" extensionName="indexedsearch" id="headerSearchForm">
   <div class="input-group">
         <f:form.textfield class="form-control search" name="tx_indexedsearch[sword]" />
         <span class="input-group-btn">
              <button class="btn btn-primary" type="button"><i class="fa fa-search"></i></button>
         </span>
    </div>
</f:form>

Upvotes: 1

Related Questions