Answer the question
In order to leave comments, you need to log in
How to search by tv parameter values in the admin panel?
I'm trying to find a ready-made solution for searching inside the admin panel by the tv parameter. Now there is a standard search, but it searches only by names, id. And I need to find exactly by the value of the tv parameter (product code).
For evo, I kind of found a doc finder, but I didn’t find a solution for revo.
Answer the question
In order to leave comments, you need to log in
If for yourself, then you can use the console (console plugin)
<?php
$search = 'слова';
$tvName = 'keywords';
preg_quote($search, '/');
foreach($modx->getCollection('modResource') as $res){
$kw = $res->getTVValue($tvName);
preg_match_all("/.*$search.*/", $kw, $matches);
if($matches[0]){
$matches['id'] = $res->get('id');
print_r($matches);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question