On /faq/ page category name is link now.

Added second-level menu to FAQ category and FAQ question pages.

Signed-off-by: S. Kozyr <s.trump@gmail.com>
This commit is contained in:
Sergiy Kozyr 2024-01-11 17:49:42 +02:00
parent 9696427a25
commit 86ce005d90
Signed by: strump
GPG key ID: C622E5563CAC205D
3 changed files with 17 additions and 6 deletions

View file

@ -85,10 +85,11 @@
<main>
{% if page.taxonomies and page.taxonomies.faq %}{# Show FAQ breadcrumbs #}
F.A.Q. ::
{% for faqCategory in page.taxonomies.faq %}
<a href="{{ get_taxonomy_url(kind="faq", name=faqCategory) }}">{{ faqCategory }}</a>
{% endfor %}
F.A.Q.
{% set categories = get_taxonomy(kind='faq') | get(key="items") %}
{% for item in categories %}
<a href="{{ get_taxonomy_url(kind="faq", name=item.name) }}">{{ item.name }}</a>
{% endfor %}
{% endif %}
{% block content %}{% endblock %}
</main>

View file

@ -7,7 +7,7 @@
{% block content %}
<h1>F.A.Q.</h1>
{%- for term in terms -%}
<h3>{{term.name}} questions</h3>
<h3><a href="{{term.permalink}}">{{term.name}} questions</a></h3>
<ul>
{%- for faq_page in term.pages | sort(attribute="extra.order") -%}
<li><a href="{{ faq_page.permalink }}">{{ faq_page.title }}</a></li>

View file

@ -5,7 +5,17 @@
{% endblock %}
{% block content %}
<h1>F.A.Q. - {{ term.name }}</h1>
F.A.Q.
{% set categories = get_taxonomy(kind='faq') | get(key="items") %}
{% for item in categories %}
{% if term.name == item.name %}
<span>{{ item.name }}</span>
{% else %}
<a href="{{ get_taxonomy_url(kind="faq", name=item.name) }}">{{ item.name }}</a>
{% endif %}
{% endfor %}
<h2>{{ term.name }} questions</h2>
{%- for faq_page in term.pages | sort(attribute="extra.order") -%}
<h3><a href="{{ faq_page.permalink }}">{{ faq_page.title }}</a></h3>
{%- endfor -%}