Adding Categories to pages

Post Reply
HowardB
Sr. Bludit
Posts: 40
Joined: Sat Jun 04, 2022 1:31 pm
Been thanked: 2 times

From the documentation I see

<?php
// Check if the user is browsing a category
if ($WHERE_AM_I=='category') {
// Get the category key from the URL
$categoryKey = $url->slug();

// Create the Category-Object
$category = new Category($categoryKey);

// Print the category name
echo $category->name();

// Print the category description
echo $category->description();
}
?>
But wondered where I should add this to the index page

Many thanks
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

What will you do?
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply