Thanks that was pretty dumb on my part. I’m used to pc and was using a mac and trying to do it with the control key.
I have a couple other questions: I appreciate all the work you do creating these extensions for free, but is there chance you could add some docs and package them with the zip file for each extension? It would be real nice to have installation instructions and some general useage examples in a readme file or something.
I want to use the multi-drop-down with the custom field extension. How do I go about searching for weblogs by multi-drop down selections? Can I do something like:
custom_field == “val1” && custom_field==”val2” && custom_field==”val9”
Or can I parse the values in the multi-drop-down and then access the weblog using those values?
What’s the correct syntax for this?
How about the doc question?
Also, I don’t want to display the contents of the custom field, I want to restrict the search depending on its contents. Maybe you’re suggesting that I first get the contents and then restrict the search based on the contents? Anyway, I’ll move that question to the correct thread if i can’t get it working.
Thanks
Hi Mark- When using this extension with the “pre-populate field option, the extension seems to place the entry_id as the value in the record, instead of the text of the field. For example, when using just the regular select field, if I have the values, pre-populated from another field, of housing, financial, insurance. And the user selects ‘insurance’ the field value displays as ‘insurance’ in the field, so if doing a custom query, I can simple search for ‘insurance’.
In the multi-select field, the field value displays as the entry_id (13975), instead of the actual value (insurance). Is this the planned behaviour? Because it really causes problems with custom queries, as well as with something a simple as converting the field from a pull down list to a multi-select field. Since the records for the pull-down field always displays the text value of the field and the multi-select field displays a numerical value for the field.
For example, I have a solution, that passes values via the path.php file to a number of custom fields. The value is a text value (housing or insurance). This sends a custom query across a number of different fields, some of the multi-select. But I can’t use the populate field from another custom field in conjunction with the Multi-Drop Down List extension, since the value returned aren’t text values, and searching for ‘housing’ returns nothing because the value is stored as an entry_id.
Mark,
First, thanks for sharing the extension, it’s just what I needed.
Second, I have a bug fix for the separator=”” attribute. The regex you’re currently using won’t allow a separator containing a single quote (‘). Changing the regex on line 578 to use a end-of-string anchor fixes the problem.
else if(preg_match("/separator\s*=\s*['\"](.*?)[\"']$/", $matches[1][$key], $seperator))
Thanks again!
-Sean
Hi Mark, Thanks for this great extension! It’s great! I’m trying to implement a multi-drop-down list custom field on a SAEF. Do you know the code I need to get this going? For example, to show the standard drop down menu, I know that it’s:
{if pulldown}
<select id="{field_name}" name="{field_name}">
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
</select>
{/if}
allgood2 - I too am looking for a way to pull the actual value rather that the entry_id.
Mark, is there anyway to add that ability in the extension, i.e. kinda like you did with File where you were able to pull different pieces of data like the path, extension, file name, etc. perhaps custom_field_data or something like that.?
Has any one gotten search in custom field working with multi drop-down list, radio buttons, or any other of Mark Hout’s custom field extensions?? The docs say
NOTE: Only custom fields of the type “Text Input”, “Textarea”, and “Drop-down Lists” are searched with this parameter.
But since technical Hout’s extensions just modify the field type “drop-down” list, I was kind of hoping there’s someway to make this work.
So far I’m not having any luck, but I am wondering if that’s just me, since I’ve had problems using the function before (for some reason if I type it in (even with multiple proof readings) it doesn’t work, but if I copy and paste from the manual, then copy and past from the field definition screen, it does). So I’m hoping maybe its just me, and others have it working. Please, please let me know.
So this extension is the best thing since sliced bread, but I am having one slight issue:
I made a drop-down to add authors to the list in this format: “Smith, J.” Unfortunately, when using {input} to add a new author it does NOT like having a comma in there! It tries to interpret this as two entries.
Anyone know how to change this setting in the extension’s PHP code??
Sean
p.s. You can see what I’m trying to do here: http://www.fouryardmedia.com/cn550ee/index.php/articles/
Awesome extension!
Is there any way to make this work with custom member fields?
I have it installed and see the option to make custom weblog fields multi-select. But, multi-select isn’t an option when editing a custom member field.
It would be great to get this working with members, too.
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}", ",")))) { ?>
... If "ITEM01" is NOT in the array of selected items, then show this code ...
<?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
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.