CMS Development

Farid
Participante | Parceiro Platinum
Participante | Parceiro 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 Avaliação positiva
1 Solução aceita
piersg
Solução
Conselheiro(a) de destaque

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 %}

 

Exibir solução no post original

4 Respostas 4
piersg
Solução
Conselheiro(a) de destaque

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 | Parceiro Platinum
Participante | Parceiro Platinum

Loop a group inside another loop group

resolver

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

Best regards

Farid

dennisedson
Gerente da Comunidade
Gerente da Comunidade

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 🤙

 


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.

0 Avaliação positiva
Farid
Participante | Parceiro Platinum
Participante | Parceiro 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 Avaliação positiva