composedcreative/expandedsearch

Craft CMS 的搜索结果,包括匹配字段、匹配值以及某些字段类型的关联值等扩展元数据

0.1.3 2016-06-02 18:09 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:42:19 UTC


README

安装

composer require composed/expandedsearch

示例

在您的搜索结果模板中

{% set expandedResults = craft.expandedSearch.search(query) %}
{% for result in expandedResults %}
    <strong data-field="{{result.matchedField}}">{{result.entry.title}}</strong><br>
    <p>{{result.matchedValue}}</p>
    <a href="{{result.entry.url}}">{{result.entry.url}}</a>
{% else %}
    <p>Sorry, no results for {{query}}.</p>
{% endfor %}

路线图

  • 改进文档
  • 增加对更多非标量字段类型的处理