We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Implementing Multi-drop down list in SAEF

Development and Programming

eclectiv's avatar
eclectiv
133 posts
17 years ago
eclectiv's avatar eclectiv

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.

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
17 years ago
Jamie Poitra's avatar Jamie Poitra

eclectiv,

SAEF’s are parsed by a completely different chunk of code than the CP side Publish Form. That means Mark would have to build a plugin or module to handle them in normal templets via the SAEF.

Jamie

       
xtz_'s avatar
xtz_
2 posts
17 years ago
xtz_'s avatar xtz_

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));
            }
       
Jim Pannell's avatar
Jim Pannell
187 posts
16 years ago
Jim Pannell's avatar Jim Pannell

Hey eclectiv - did you ever get this working? I’m in the same position and it’s driving me slightly mad. The code that xtz_ has posted looks encouraging, but I’ve no idea what to do with it unfortunately.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.