【问题标题】:TYPO3 index_search no markup result in FLUID/ExtBaseTYPO3 index_search 在 FLUID/ExtBase 中没有标记结果
【发布时间】:2016-09-19 18:03:33
【问题描述】:

在默认 indexsearch 扩展中,我在搜索结果中突出显示了关键字,但是当我使用 FLUID 版本时它不起作用,我发现控制器的功能不同,为默认模板和 FLUID 准备了描述。 错字3/sysext/indexed_search/Classes/Controller/SearchController.php

452 行 --- 为 FLUID 准备

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

(bool)!($this->searchData['extResume'] && !$headerOnly) 应该给 'false' 但没有。我检查了 ts extResume = 1headerOnly = false。所以这似乎是错误的构造?

(bool)!($this->searchData['extResume'] && !$headerOnly) 替换为false 时。我得到了 murkups,但我还需要更改流体模板中的输出格式 来自---

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

到-----

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

现在它可以工作了,但我仍然不明白为什么默认情况下它不能工作?

【问题讨论】:

  • 这至少在 7.6 中已修复,但它显示页面内容的开头 - 而不是与点击相关的部分...

标签: typo3 fluid-layout extbase typo3-7.6.x


【解决方案1】:

还有另一种方法:

在 Searchform 中定义一个隐藏字段:(Resource/Private/Partials/Form.html)

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

Searchsresult.html 中,我会使用 format.raw 而不是 format.html。

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

【讨论】:

    【解决方案2】:

    我认为这是一个错误 - 我已经为此创建了一个错误报告。

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

    也许您可以提供一个补丁并将其推送到审查系统 - 这将非常有帮助!

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-16
    • 2014-02-04
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-20
    相关资源
    最近更新 更多