mbhusty
@mbhusty

Как прикрутить simplesearch к своей таблице в MODX?

Есть несколько кастомных компонентов со своими таблицами. Пытаюсь прикрутить поиск по данным в них, и ничего кроме simplesearch не нашел.
Может кто-то сталкивался с подключением поиска по своим таблицам? У сниппета есть параметр &customPackages, но не совсем понятно как его использовать
  • Вопрос задан
  • 216 просмотров
Пригласить эксперта
Ответы на вопрос 1
i__dmitry
@i__dmitry
Weaving a web
В доках же прямо написано, что делать:
https://docs.modx.com/current/en/extras/simplesear...
Раздел "Searching Custom Tables".
&customPackages=`quipComment:body:quip:{core_path}components/quip/model/:quipComment.resource = modResource.id`


Let's break down each part:

className - The class name of the table you want to search. Here, it's QuipComment.
fieldName(s) - A comma-separated list of column names to search. We did 'body', you could also have done 'body,email' or whatever.
packageName - The name of the schema Package to add. This one is called quip.
packagePath - The path to the model/ directory where the package is located.
joinCriteria - The SQL to join the table you want to search and the modResource table. Your table must have some connection to the Resource it's on (otherwise SimpleSearch won't know how to load a URL for it!)
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы