Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hello everybody,
I have a problem with conditional fields, after trying to follow the directions from viewtopic.php?f=5&t=11512 I finally got lost, unable to apply it.



Code: Select all
 <cms:editable name='team_group' label='Sezione Team' desc='Team' type='group' collapsed='1' order='4' />
          <cms:repeatable name='team_borrelli' label='Team Borrelli' stacked_layout='0' group='team_group'>
       
           
          <cms:editable name='immagine_team' hidden='1'
             label="Immagine Collaboratore"
            desc='Misure slide in px 1920x784'
             width="272"
          height="784"
             show_preview='1'
             preview_width="150"
             type='image' />
         
          <cms:editable name='alt_immagine_team' hidden='1'
             label="ALT immagine" desc='Parametro ALT immagine'
             type="text" />
         
         
          <cms:editable name='nome_membro_team'
             label="Nome membro Team" desc='Nome del menbro team'
             type="text" />
         
          <cms:editable name='link_membro'
             label="Link Membro" desc='Link membro'
             type="text" />
         
         
          <cms:editable name='tag_title_link_membro'
             label="Tag Title" desc='Parametro TITLE al link'
             type="text" />
         
          <cms:editable name='ruolo_membro'
             label="Ruolo membro" desc='Ruolo del membro'
             type="text" />
         
         
           <cms:editable name='opzione_facebook' hidden='1'
              label="Opzione Facebook" desc='Spunta la casella per facebook" '
              type="checkbox"
           opt_values="SI"/>
          
           <cms:editable name='opzione_twitter' hidden='1'
              label="Opzione Twitter" desc='Spunta la casella per twitter" '
              type="checkbox"
           opt_values="SI"/>   
          
          
         
            
          <cms:func _into='my_cond' opzione_facebook=''>
        <cms:if "<cms:is 'SI' in=opzione_facebook />">show<cms:else />hide</cms:if>
      
      
    </cms:func>
         
          <cms:editable name='link_facebook'
             label="Link Facebook" desc='Link Facebook'
             type="text" />
         
        </cms:repeatable>    


In fact if the parameter box
Code: Select all
<cms:editable name='opzione_facebook' hidden='1'
              label="Opzione Facebook" desc='Spunta la casella per facebook" '
              type="checkbox"
           opt_values="SI"/>


has popped up,
I would like it to be visible
Code: Select all
  <cms:editable name='link_facebook' 
             label="Link Facebook" desc='Link Facebook'
             type="text" />


In practice, the need I have is to insert various social links if not in possession (and therefore I would have three boxes to activate facebook, twitter, instagram)

Could someone help me figure out how to do it?
Thank you
Hi,

I think your code is missing just the last bit where we connect the <cms:func> to the target region;
The following should do the trick
Code: Select all
<cms:func _into='my_cond' opzione_facebook=''>
    <cms:if "<cms:is 'SI' in=opzione_facebook />">show<cms:else />hide</cms:if>
</cms:func>

<cms:editable name='link_facebook'
    label="Link Facebook" desc='Link Facebook'
    type="text"
    not_active=my_cond
/>

The only addition above is the not_active=my_cond line that makes the missing connection (make sure to refresh the page as super-admin).

Hope this helps.
:shock: oh God
an incredible mistake that I hadn't seen.
Thanks kk
3 posts Page 1 of 1