Oleh V Karun
Oleh V Karun

Reputation: 736

TYPO3 index_search no markup result in FLUID/ExtBase

In default indexsearch extension i have highlighted keywords in search result, but when i use FLUID version it not work, I find that are different function it Controller, witch prepared description for default template and for FLUID. typo3/sysext/indexed_search/Classes/Controller/SearchController.php

452 line --- prepared for FLUID

  $resultData['description'] = $this->makeDescription(
        $row,
        (bool)!($this->searchData['extResume'] && !$headerOnly),
        $this->settings['results.']['summaryCropAfter']
    );

(bool)!($this->searchData['extResume'] && !$headerOnly) shoud give 'false' but didn't. I check ts extResume = 1 and headerOnly = false. So it seems to be wrong construction?

When replace the (bool)!($this->searchData['extResume'] && !$headerOnly) to false. I get murkups but also i needed change output format in fluid template from ---

    ...
    <f:if condition="{row.headerOnly} == 0">
        <p class="tx-indexedsearch-description">{row.description}</p> 
...

to -----

...
<f:if condition="{row.headerOnly} == 0">
    <p class="tx-indexedsearch-description"><f:format.html>{row.description}</f:format.html></p>
...

Now it work, but i still don't understand why it not work by default?

Upvotes: 1

Views: 606

Answers (2)

Franz Vinzenz
Franz Vinzenz

Reputation: 26

There is an alternative Method:

In the Searchform define a hidden Field: (Resource/Private/Partials/Form.html)

<f:form.hidden name="search[extResume]" value="1" />

In Searchsresult.html i would use format.raw instead of format.html.

<p class="tx-indexedsearch-description"><f:format.raw>{row.description}</f:format.raw>

Upvotes: 1

Tobias Gaertner
Tobias Gaertner

Reputation: 1184

I think its a bug - I already created a bugreport for this.

https://forge.typo3.org/issues/77682

Maybe you can provide a patch and push it to the review-system - that would be very helpful!

Upvotes: 1

Related Questions