• Resolved ominem

    (@ominem)


    Hi, I have this code and works great:

    [if activities]
      <div class="activities-slider-container">
      <h3>Activities</h3>
      [each activities]
        <div class="single-activity">
          <div class="grid-columns-2">
            <div>
             [if activities.fotos_actividad]
               {@activities.fotos_actividad.guid}
             [/if]
            </div>
          <div>
           {@activities.post_title}
           {@activities.post_content} 
           [if activities.horario_actividad]
             <h4>Horario</h4
             {@activities.horario_actividad}	
           [/if]
          </div>
         </div>
        
    </div>
       [/each]
      </div>
    [/if]

    on the front page all fields are displayed except those inside a nested [if].
    ?Pods template editor does not support nested if?

    • This topic was modified 1 year ago by ominem.
    • This topic was modified 1 year ago by ominem.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Within the [each] you would not specify the top-level relationship field name there. It treats it as a sub-template at that point and you would reference activities.fotos_actividad as just fotos_actividad instead.

    More details here: https://docs.pods.io/displaying-pods/template-tags/each-loop-tag/#EACH_Block_for_Relationship_Field

    Thread Starter ominem

    (@ominem)

    Ok, I changed

    [if activities.fotos_actividad]

    to

    [if fotos_actividad]

    And worked fine. I’m still getting this 2 notices:

    Notice: Undefined offset: 0 in /home/rutadelvinodegrancanari0/www/latest/wp-content/plugins/pods/src/Pods/Whatsit.php on line 1111

    Notice: Undefined index: name in?/home/rutadelvinodegrancanari0/www/latest/wp-content/plugins/pods/classes/Pods.php?on line?792

    Any ideas?

    • This reply was modified 1 year ago by ominem.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Nested [if] in templates editor’ is closed to new replies.