I have a Faq page with an accordion, and it works perfectly, yet I have two identical pages in the same faq folder with the same exact code but it only works on the index.twig and not on the other two pages. On all the pages I have under the Faq a contact form and on the other two pages there is an extra code for if an error occurs or a success. I did the same principle on my contact page also three pages and two with the success and error code in it.
It goes wrong with this code:
{% for Faqs in entry.faqs.all() %}
<div class="card-header">
<h4 class="card-title m-0">
<a class="accordion-toggle" data-bs-toggle="collapse" data-bs-parent="#accordion{{count}}" href="#collapse{{count}}">
<i class="fas fa-users"></i>
{{Faqs.question}}
</a>
</h4>
</div>
<div id="collapse{{count}}" class="collapse show{{count}}">
<div class="card-body">
<p class="mb-0 text-5">{{Faqs.answers}}</p>
</div>
{% set count = count+1 %}
</div>
{% endfor %}
I get an error Variable "entry" does not exist, yet the same code works on the index.twig and not on the other two.
And before you think what other code, it is just html underneath the form.
What am I doing wrong, and why does it work with the contact pages and not on the faq pages???