2 of 2
2
Customized SAEF - how to populate dropdowns?
Posted: 30 July 2008 10:12 AM   [ Ignore ]   [ # 19 ]  
Lab Assistant
RankRank
Total Posts:  101
Joined  08-12-2007

It took me a while to find Phoebe Bright’s plugin so I’m commenting to help others that might be trying to find this.

I didn’t really like the explanations I’ve seen of what this add-on is or what it’s used for, and I had to read three different post to get a clear understanding. So here goes.

First of all the name seems a bit misleading. This thing is more about making SAEF easier and more flexible than it is about popups (just an opinion)

If you’re using custom_fields in your SAEF you probably want to show these fields with more flexibility than the standard {custom_fields}{/custom_fields} tag wrap.

This wonderful plugin lets you put your custom_fields in your SAEF without using the {custom_fields} tag wrap. The advantages are you can label, order, and style your fields with more flexibility than using the standard “tag wrap’ method. wink

For dropdowns in an ENTRY form I use:

{exp:pops:pop_input field="job_type"}
<label for="{field_name}">Job Type</label>
{popup}
<input type="hidden" name="{field_format}" value="none" />
{/exp:pops:pop_input} 

For dropdowns in an EDIT form I use:

{exp:pops:pop_input field="job_type" value="{job_type}"}
<label for="{field_name}">Job Type</label>
{popup}
{
/exp:pops:pop_input} 

If using in a SEARCH TEMPLATE, might want first value in the list to be Any

{exp:pops:pop_input value="{job_type}" field="job_type" first="Any"}
<label for="{field_name}">Job Type</label>
{popup}
<input type="hidden" name="{field_format}" value="none" />
{/exp:pops:pop_input} 

For any other field types (textarea, text, etc.) I use:

{exp:pops:pop_input field="job_description"}
   
<label for="{field_name}">Job Description</label>
   <
textarea id="{field_name}" name="{field_name}" rows="6" cols="40">{value}</textarea>
   <
input type="hidden" name="{field_format}" value="none" />
{/exp:pops:pop_input} 

This is a god send for me thanks to Phoebe Bright for such a great addition to the SAEF user community grin

Profile
 
 
Posted: 10 October 2008 04:55 PM   [ Ignore ]   [ # 20 ]  
Summer Student
Total Posts:  1
Joined  06-03-2008

Does this work with related fields then as well? The examples in the post seem to show that related fields should still use the custom fields tags such as

{custom_fields}{if relationship}
<select name="{field_name}">
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
</select>
{/if}
{
/custom_fields} 

I am new to using SAEF with EE so I have a lot to learn…
[edit]
Not able to get this to create a popup with the following for a custom related field

{exp:pops:pop_input field="f_far_left"}
<label for="{field_name}">Far Left</label>
{popup}
<input type="hidden" name="{field_format}" value="none" />
{/exp:pops:pop_input} 

The field_label and field_format do get parsed though

<label for="field_id_20">Far Left</label>
        
<
input type="hidden" name="field_ft_20" value="none" /> 

I can use firebug to get values from the plugin so is there anything I *should* see so I can perhaps debug what I am doing wrong?

Thanks!

Profile
 
 
Posted: 14 January 2010 10:11 AM   [ Ignore ]   [ # 21 ]  
Grad Student
Avatar
Rank
Total Posts:  61
Joined  07-07-2008

I had need for a relationship dropdown today so I’ve put together a plugin to retrieve a custom field, and if necessary also it’s options in a variable pair. It’s available on my website if you need it.

So…

{exp:linssen_saef_field name="my_relationship_field"}
  
<p><label for="{id}">{label}</label><br />
    <
select name="{id}" id="{id}">
      
{options}<option value="{value}">{name}</option>{/options}
    
</select>
  </
p>
{/exp:linssen_saef_field} 

And for a text field:

{exp:linssen_saef_field name="my_text_field"}
  
<p><label for="{id}">{label}</label><br />
    <
input type="text" name="{id}" id="{id}" value="" />
  </
p>
{/exp:linssen_saef_field} 
 Signature 

Wil Linssen | Twitter

Profile
 
 
Posted: 14 January 2010 10:25 AM   [ Ignore ]   [ # 22 ]  
Lab Assistant
RankRank
Total Posts:  101
Joined  08-12-2007

That’s great don’t have a lot of time to check it out this week but it definitely will get put to good use eventually!

Profile
 
 
   
2 of 2
2