Indexed Search extbase htmltags in output
Asked Answered
R

2

8

I am using TYPO3 7.6.11 and indexed_search 7.6.0.

I use the extbase plugin for indexed_search and in the output it escapes the HTML-Tags to mark the searchword. For example, when I search for "search" I get this output:

Test text with<strong class="tx-indexedsearch-redMarkup">search</strong> pattern.

I found this bugfix to this problem: https://forge.typo3.org/issues/77901

But the file PageBrowsingResultsViewHelper.php doesn't look exactly the same, and even when I add the variable protected $escapeOutput = false; it doesn't change anything.

Any idea where this is come from and where I can disable the escaping?

Repetend answered 8/5, 2017 at 13:12 Comment(0)
R
2

It was another extension who overwrote a Partial of tx_indexedsearch that caused the problem.. -> Always check if the template you are working on is the one that gets outputted ;)

Repetend answered 24/5, 2017 at 15:40 Comment(0)
A
0

This happen because of format object rendering.your result will render in {row.description} object and initially there is no format set. you have to format your result({row.description}) to the HTML. For that:

Go to the search result file.
yourindexsearch/templatingpath/IndexedSearch/Partials/Searchresult.html

Here is the complete file:

<div class="fourffCom col-sm-6">
    <f:format.html><h2>{row.title}</h2></f:format.html>

    <f:if condition="{row.headerOnly} == 0">
        <!-- Format html -->
        <f:format.html>{row.description}</f:format.html>
        <ul>
            <li>
                <p><f:translate key="result.size" />&nbsp;</p>
                <b>{row.size}</b>
            </li>
            <li>
                <p class="tx-indexedsearch-text-item-crdate"><f:translate key="result.created" />&nbsp;</p>
                <b class="tx-indexedsearch-text-item-crdate"><f:format.date>@{row.created}</f:format.date></b>
            </li>
            <li>
                <p class="tx-indexedsearch-text-item-mtime"><f:translate key="result.modified" />&nbsp;</p>
                <b class="tx-indexedsearch-text-item-mtime"><f:format.date>@{row.modified}</f:format.date></b>
            </li>
            <li>

            </li>
            <li>
                <p><f:translate key="result.path" />&nbsp;</p>
                <b><f:format.html>{row.path}</f:format.html></b>
            </li>
        </ul>
    </f:if>

    <f:if condition="{row.headerOnly} == 1">
        <!-- Format html -->
        <f:format.html>{row.description}</f:format.html>
    </f:if>

    <f:if condition="{row.subresults}">
        <p class="tx-indexedsearch-list">
            <f:for each="{row.subresults.items}" as="subrow">
                <f:render partial="Searchresult" arguments="{row: subrow}" />
            </f:for>
        </p>
    </f:if>
</div>
Annapolis answered 29/5, 2017 at 12:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.