D
D
Dmitry Inozemtsev2016-07-05 14:43:06
MODX
Dmitry Inozemtsev, 2016-07-05 14:43:06

MODx Evo, is it possible to search by MultiTV?

Hello!
Faced such a problem: there is a catalog site for MODx Evo. All positions have a number of parameters (TV), such as article, length, width, weight, etc., and there is one advanced parameter in which arbitrary characteristics are inserted for each position, implemented through MultiTV. Search on the site is implemented through AjaxSearch, and TV values ​​in the search do not work, i.e. this advanced option is not searched.
Empirically, it was found out that the problem is that in its raw form, the TV value looks like a raw JSON array, like:

{"fieldValue":[ ["Коллекция","Europlank"],["Дерево","дуб"],["Количество полос","1-полосный"],["Длина, мм.","2215"],["Ширина, мм.","164"],["Толщина, мм.","13,2"],["Эффект обработки","Тонирование"],["Браширование","да"],["Фаска","нет"],["Дополнительное защитное покрытие","лак Classic"],["Замковая система","T-lock"],["Вариация цвета под воздействием УФ","умеренная"],["Изменение оттенка под воздействием УФ","темнеет"],["Твердость древесины (стандарт - Дуб)","стандарт"],["Коэффициент твердости","3,7"],["Селекция","Рустик"],["Метраж 1 упаковки (кв.м)","1,68"] ],"fieldSettings":{"autoincrement":1}}

And it also became clear that the search is carried out correctly if the TV value does not contain symbols that are "dangerous" for the modex - curly and square brackets.
I can't understand how it is possible to pass the value of this TV to the AjaxSearch snippet, but without unnecessary characters. There was even an idea to write some kind of plug-in that would duplicate TV when saving the document, cutting off all unnecessary brackets, but it looks too crutch.
I would be grateful for any ideas!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mister Lexus, 2016-09-06
@mr-lexus

If I were you, I would write a search snippet.
I think that this method is unacceptable for you.
I see 2 ways:
1) A plugin (as you said) that will write to TV json converted to a string
2) Finish AjaxSearch (crutch)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question