<p>We would need to know how you render your title. Otherwise it would just be </p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;title&gt;{% if title is defined %}{{ title }} {% endif %}{{ siteName }}&lt;/title&gt;
&lt;/head&gt;
</code></pre>

<p>and in your <code>category</code> template</p>

<pre><code>{% set title = 'Category ' ~ category.title %}
</code></pre>

CC BY-SA 3.0
2017-11-14T19:07:35.793Z
2017-11-14T19:07:35.793Z
Robin Schambach
<p>I am trying to get the page title of the categories page. Currently it shows as: <code>category-name</code>, but I would like to have it set to <code>Category Name</code> to match the <code>category.title</code>.
My <code>categories/index.html</code> looks like this:</p>

<pre><code>{% set title = category %}

{% block content %}

    {% set entries = craft.entries.relatedTo(category) %}

    {% for entry in entries %}

        -- Code Here --

    {% endfor %}

{% endblock %}
</code></pre>

<p>Thanks in advance.</p>

<templating><categories><category><titles>
Setting the page title for a category page
# Setting the page title for a category page

(Asked by: username_0 on 2017-11-14)

I am trying to get the page title of the categories page. Currently it shows as: category-name, but I would like to have it set to Category Name to match the category.title.
My categories/index.html looks like this:
{% set title = category %}

{% block content %}

    {% set entries = craft.entries.relatedTo(category) %}

    {% for entry in entries %}

        -- Code Here --

    {% endfor %}

{% endblock %}

Thanks in advance.

**Tags:** templating, categories, category, titles


---

## 1 answers

### Answer by username_1 on 2017-11-14. Score: 3 | Accepted answer

We would need to know how you render your title. Otherwise it would just be 



    
    {% if title is defined %}{{ title }} {% endif %}{{ siteName }}


and in your category template
{% set title = 'Category ' ~ category.title %}


---

