stw-on/craft-extended-search 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stw-on/craft-extended-search

Composer 安装命令:

composer require stw-on/craft-extended-search

包简介

Retrieve additional context for Element searches

README 文档

README

This repository is a fork of https://github.com/mustasj-as/expanded-search, which is https://github.com/composedcreative/craft-expandedsearch ported from Craft 2 to Craft 3. It is an expansion of Crafts search, which gives you a context for search hits.

Requirements

This plugin requires Craft CMS 3.1.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

    cd /path/to/project
    
  2. Then tell Composer to load the plugin:

    composer require stw-on/craft-extended-search
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Extended Search.

Using Extended Search

The first parameter is the search term. Which will be salted automatically: *{term}* The second is settings.

Setting Type Purpose Default
length int Cuts off the search value at given length 300
section array/string section names to search in null (all sections)
sectionId array/int id of sections to search in null (all sections)
limit int how many results to return (pagination) 0 (all)
offset int how many results to skip (pagination) 0
subLeft bool to use fuzzy search left true
subRight bool to use fuzzy search right true
type string element type to search for (e.g. entry or asset entry

In your search results template

{% set results = craft.extendedSearch.search(query, { sections: ['news'], length: 150 }) %}
{% for result in results %}
    <strong data-field="{{ result.matchedField }}">{{ result.entry.title }}</strong><br>
    <p>{{result.matchedValue}}</p>
    <a href="{{ result.element.url }}">{{ result.element.url }}</a>
{% else %}
    <p>Sorry, no results for {{ query }}.</p>
{% endfor %}

统计信息

  • 总下载量: 2.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固