I’m trying to implement a multi-drop-down list custom field on a SAEF using Mark Huot’s extension. Does anyone know how I’d 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}
I’m not sure how to implement this with the multi-drop down menu.
You can do like this in cp.publish.php and explode with — when u call the datas
if (count($cust_fields) > 0)
{
/* PUT THIS*/
foreach($cust_fields AS $k=>&$field)
{
$txt = '';
if(is_array($field))
foreach($field AS $val)
$txt == '' ? $txt .= $val : $txt .= ' --- '.$val;
if($txt != '')
$field = $txt;
preg_match("#field_id_(.*)_(.*)#Ui",$k,$isfuckmatch);
if($isfuckmatch)
unset($cust_fields[$k]);
}
/***************************/
$cust_fields['site_id'] = $PREFS->ini('site_id');
// Submit the custom fields
$DB->query($DB->insert_string('exp_weblog_data', $cust_fields));
}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.