Admin Search Multiple Columns
I know that this feature was requested for Pods UI but has anyone been able to figure out how to search through other columns other than the 'name' column?
TIA.
5 Answers
Pod.class.php - line 486
if (!empty($_GET['search']))
{
$val = pods_url_variable('search', 'get');
$search = "AND (t.name LIKE '%$val%' OR t.anothercolumn LIKE '%$val%' OR t.anothercolumn LIKE '%$val%')";
}
edited May 26 '10 at 7:31
You would have to use a custom WHERE clause to do this using the LIKE operative...
If you require that the results be in some sort of relevance order do a google search on sql order by relevance. Make sure that you are looking @ mySQL topics too and not mssql ones. There are many resources out there on that matter. You might even need to write a custom query for that...
Good luck...
Not really an answer but more of a request for further clarification:
Can anybody tell me which file I would have to edit to make this happen? (by 'this' I mean forcing Pods to search additional columns and/or forcing Pods to search a different column other than the Name column).
@jackson THANK YOU
@ modesto.mouse i ran into that same issue with the 'Browse Content' page b/c i'm using multiple pods as well. I did some digging but ran into a wall. here is the code that seems to specify what the search bar in the 'Browse Content' page searches for (it's in core/manage_content.php):
if (!empty($dtname))
{
$where[] = "t.name = '" . pods_sanitize($dtname) . "'";
}
if (!empty($_GET['keywords']))
{
$where[] = "p.name LIKE '%" . pods_url_variable('keywords', 'get') . "%'";
}
i just need a way to allow admin(s) to search through multiple pods using a column other than or in addition to the name column. i see this happening in either the 'Browse Content' page (which is able to call all pods but searches only the name column), or in a custom Pods UI page that pulls all pods (if possible then jackson's solution will work here). only thing is i'm no ninja programmer so if anyone can lend a hand- it will be very much appreciated!
TIA.
edited May 27 '10 at 4:14
Perhaps this article will help you:
edited May 26 '10 at 9:25


