I need to be able to display the Category Title of a single category (as a h1 tag for a page displaying a list of the entries for that category). I can successfully display the relevant entries for the category on the page, but when I have tried to display the category title it displays all of the categories titles (in a loop), not just the single category title.
My code:
{% if craft.request.getParam('category') is not null %}
{% set category = craft.categories.slug(craft.request.getParam('category')) %}
{% set products = craft.entries.section('products').relatedTo(category).find() %}
{% else %}
{% set products = craft.entries.section('products').find() %}
{% endif %}
<div class="top-title">
{% for category in craft.categories.group('productType').find() %}
<header class="flush"><h1>{{ category.title }}</h1></header>
{% endfor %}
Any help would be very much appreciated! Many thanks!