Category Page

This page holds a list of subsequent categories and questions, as mentioned here, in a similar way to Index Page Helpjuice loops through the content to present it, but it takes from the current category to list subcategories and/or questions.


The same structure also is used to subcategories inside categories and on it goes.


Looping through subcategories

and also listing the questions

 {% for subcategory in subcategories %}
            ...
         <a href="{{ subcategory.url }}">{{ subcategory.name }}</a>
            ...
        <ul ...>
              {% for question in subcategory.published_questions | limit:5 %}
                <li>
                      <a href="{{ question.url }}">{{ question.name }}</a>
                </li>
              {% endfor %}
        </ul>

    {% if subcategory.questions.size > 5 %}
      <a href="{{subcategory.show_all_questions_link}}" ... >See all {{subcategory.questions.size}} topics</a>
    {% endif %}
  {% endfor %}


Personalized Category/Subcategory text

Inside the category loop just test with a if condition to make it appear a subtext related to the category

{% for subcategory in subcategories %}
            ...
         <a href="{{ subcategory.url }}">{{ subcategory.name }}</a>
{% if subcategory.name == 'Customization'%}
<p>Subtext related to the category</p>
{%else%}
<p>Subtext related to the category</p>
{%endif%}

        <ul ...>

Just a parenthesis here the else condition is not required, and you can also use other conditions to cover the realm of possibilities using

{%elsif  subcategory.name == 'Customization'%}



Was this article helpful?

Can't find what you're looking for?

Contact Support