Great extension Mark! You da’ man! :D
Just if it helps anyone, here is my approach to testing for values:
On my template:
<?php if(!(in_array("ITEM01", string_to_array("{custom-field-name}", ",")))) { ?>
<p>... If "ITEM01" is NOT in the array of selected items, then show this code ...</p>
<?php } ?>
My functions:
<?php
// @about: Trim beginning and ending white space from referenced $value.
// @ref: http://us2.php.net/trim
function trim_key_value(&$value) {
$value = trim($value);
}
// @about: Convert delimited string to array.
// @param 01: Delimited string to convert.
// @param 02: Delimiter to explode.
function string_to_array($str, $delimiter) {
$return = explode(",", $str); // Convert delimited string to an array.
array_walk($return, 'trim_key_value'); // Remove white spaces from array keys.
return $return; // Return results.
}
?>
(I include my functions at the head of my master template. PHP set to output for template that has function call.)
Again, amazing work Mark!
Cheers,
Micky