A
A
Artur Lastname2017-03-29 09:18:38
MODX
Artur Lastname, 2017-03-29 09:18:38

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

1 answer(s)
D
display: block, 2017-03-29
@Kekemeke

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);
    } 
}

From this, you can finish the snippet for the admin panel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question