CMS Development

Farid
Participante | Partner nivel Platinum
Participante | Partner nivel Platinum

Loop a group inside another loop group

resolver

Hi,

I am wondering if it's possible to loop a group inside the looped parent group.

I get this error

Farid_0-1611855120548.png

Please help me how can I do it

 

Thanks in forward

Kind regards

Farid

0 Me gusta
1 Soluciones aceptada
piersg
Solución
Asesor destacado

Loop a group inside another loop group

resolver

Hi @Farid you just need to use a nested for loop:

 

{% set fils = module.fil %}
{% for fil in fils %}
  {{ fil.filter_title }}
  {% for accordion in fil.accordion %}
  ..
    {# accordion code here #}
  ..
  {% endfor %}
{% endfor %}

 

Ver la solución en mensaje original publicado

4 Respuestas 4
piersg
Solución
Asesor destacado

Loop a group inside another loop group

resolver

Hi @Farid you just need to use a nested for loop:

 

{% set fils = module.fil %}
{% for fil in fils %}
  {{ fil.filter_title }}
  {% for accordion in fil.accordion %}
  ..
    {# accordion code here #}
  ..
  {% endfor %}
{% endfor %}

 

Farid
Participante | Partner nivel Platinum
Participante | Partner nivel Platinum

Loop a group inside another loop group

resolver

Hi @piersg 
Thank you so much. Your codes work well (y)

Best regards

Farid

dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Loop a group inside another loop group

resolver

Hey @Farid 

Could you post more of your code?  The yellow indicates a warning, not an error

@Bryantworks@Anton can you all lend a hand 🤙

 

0 Me gusta
Farid
Participante | Partner nivel Platinum
Participante | Partner nivel Platinum

Loop a group inside another loop group

resolver

Hi @dennisedson 

 

Yes, sure! Here are other screens from my job.

Farid_3-1611910991863.png

Farid_4-1611911020880.png

 

Actually, my goal is to have a group of filters, which each filter has a group of accordions inside. In this case, Filter Group has a loop that works fine and an accordion group inside the filter group has also loop and shows nothing in output.

Farid_1-1611910789741.png

Farid_7-1611911305231.png

 

Farid_5-1611911106175.pngFarid_6-1611911146020.png

Please tell me if it's possible at all to have a repeat group inside another repeated group.

Thanks in forward

My best regards

Farid

 

0 Me gusta