You are here

faq-questions-inline.html.twig in Frequently Asked Questions 8

Template file for the FAQ page if set to show the questions inline.

Available variables:

  • nodes: The array of nodes to be displayed. Each node stored in the $nodes array has the following information:

    • question: The question text.
    • body: The answer text.
    • links: Represents the node links, e.g. "Read more".
  • question_label: The question label, intended to be pre-pended to the question text.
  • answer_label: The answer label, intended to be pre-pended to the answer text.
  • use_teaser: Tells whether $node['body'] contains the full body or just the teaser

File

templates/faq-questions-inline.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template file for the FAQ page if set to show the questions inline.
  5. *
  6. * Available variables:
  7. * - nodes: The array of nodes to be displayed. Each node stored in the $nodes array has the following information:
  8. * - question: The question text.
  9. * - body: The answer text.
  10. * - links: Represents the node links, e.g. "Read more".
  11. * - question_label: The question label, intended to be pre-pended to the question text.
  12. * - answer_label: The answer label, intended to be pre-pended to the answer text.
  13. * - use_teaser: Tells whether $node['body'] contains the full body or just the teaser
  14. *
  15. * @see template_preprocess_faq_questions_inline()
  16. *
  17. * @ingroup themable
  18. */
  19. #}
  20. <a id="top"></a>
  21. <div>
  22. {% if nodes|length > 0 %}
  23. {% for node in nodes %}
  24. <br />
  25. <div class="faq-question">
  26. {% if question_label is not empty %}
  27. <strong>
  28. {{ question_label }}
  29. </strong>
  30. {% endif %}
  31. {{ node.question }}
  32. </div><!-- Close div: faq-question -->
  33. <div class="faq-answer">
  34. {% if answer_label is not empty %}
  35. <strong>
  36. {{ answer_label }}
  37. </strong>
  38. {% endif %}
  39. {{ node.body }}
  40. {% if node.links is defined %}
  41. {{ node.links }}
  42. {% endif %}
  43. </div><!-- Close div: faq-answer -->
  44. {% endfor %}
  45. {% endif %}
  46. </div><!-- Close div -->