Display User Name Rather than Number in Advanced Find

4 posts by 2 authors in: Forums > CMS Builder
Last Post: April 24, 2013   (RSS)

Hi,

There is a way you can do this by adding a search for the meta field createdBy.fullname, if you add this to your search fields:

Created by user|createdBy.fullname|match

A drop down will be added to the advanced search with all of the user names. You don't have to add any extra fields to the section to get this working. 

You can also use this as a list field for the section list page as well.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By chrise - April 24, 2013

Thanks Greg. Could you point me in the direction of where I could find the various built in field names?

Specificaly, now I am still testing advanced find options and Id like to be able to search for a range in a field we call "published_date". Is there a function other than match that I could use for a range rather than a drop down box.

I hope I explained this well.

-Chris

Hi Chris,

You can search a range in a date field by using the min and max variables:

Published Before|published_date|max
Published After|published_date|min

There isn't any documentation on the built in field names as they are dynamically created depending on the fields in your account section. The easiest way to list them is using the getRecords function. If you create a file with the following contents:

  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('C:/path/to/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

  // load records from 'blog'
  list($blogs, $blogMetaData) = getRecords(array(
    'tableName'   => 'blog',
    'loadUploads' => true,
    'allowSearch' => false,
  ));

  showme($blogs[0]);
  exit;

You'll need to change the table name to the section you want the fields listed from.

When you view it in a browse it will list all of the fields and meta fields available in that section.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com