ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Relationship fields adding unneccesary <br /> tags

August 13, 2013 4:13pm

Subscribe [2]
  • #1 / Aug 13, 2013 4:13pm

    design132

    101 posts

    I don’t know why, but this code:

    {custom_fields}
    
    
     {if relationship}
    
     <label for="{field_name}">{if required}* {/if}{field_label}</label>
    
       
      
                    <select name="{field_name}" >
                                    <option value="">--Please select--</option>
                            {exp:channel:entries channel="locations"  author_id="CURRENT_USER" }
                                    <option value="{entry_id}">{therapist_state}</option>
                            {/exp:channel:entries}
                    </select>
            {/if}
    
    
    
    {/custom_fields}

    spits out an INSANE amount of

    
    

    tags between this: {custom_fields} and this {if relationship}.

    What can I do to remove that?

    ‘BTW, this is what it renders:

    
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
    
    
    
    
    
     
     <label for="therapist_location1">Therapist Location1</label>
    
       
      
                    <select name="therapist_location1" >
                                    <option value="">--Please select--</option>
                            
                                    <option value="45">Arizona</option>
                            
                    </select>
            
    
    
    
    
    
     
     <label for="therapist_location2">Therapist Location2</label>
    
       
      
                    <select name="therapist_location2" >
                                    <option value="">--Please select--</option>
                            
                                    <option value="45">Arizona</option>
                            
                    </select>
            
    
    
  • #2 / Aug 13, 2013 7:04pm

    Rob Allen

    3105 posts

    It will do because you are looping custom_field over and over even when there’s no content for it, put the two BR’s before the closing {/if} and see if that works

  • #3 / Aug 13, 2013 7:07pm

    design132

    101 posts

    OMG you freaking rock.  I can’t believe this was the issue, but your explanation made sense and it fixed it.  Thanks!!!!!!!!!!!!!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases