Skip to main content

Setting up type-specific index pages (v2)

By default the Tuskfish home page displays a single combined stream of all content types. If you want to set up an index page with a specific type of content (eg. news articles, downloads, or images), open the Listing controller trust_path/libraries/tuskfish/class/Tfish/Content/Controller/Listing and add a line to restrict the content type, for example to only list downloads you would use:


So the display() function would become:

public function display(): array
        $cacheParams = ['page' => 'downloads'];

        $start = (int) ($_GET['start'] ?? 0);

        if (!empty($start)) $cacheParams['start'] = $start;
        // Restrict content to downloads.

        $id = (int) ($_GET['id'] ?? 0);
        if (!empty($id)) {
            $cacheParams['id'] = $id;
        } else {

        return $cacheParams;

Alternatively, you could set this up as a separate page with a custom URL, and keep the standard all-content Listing page intact.

Copyright, all rights reserved.