1

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.

2

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

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

and in your category template

{% set title = 'Category ' ~ category.title %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.