Roots Discourse

Controller for custom taxonomy not working


So I have a custom taxonomy: maintenance_package

I am using the following blade template which is working fine…


For bug fixing this issue, it just has this code in it…


    {{ $testing_controller }}

What I cant seem to do is get a controller working with the template.

My assumption was that it would be named this…


And its contents would be this…


namespace App\Controllers;

use Sober\Controller\Controller;

class TaxonomyMaintenancePackage extends Controller
    public function TestingController()
        return 'Hello World';

** I have also tried it as a static function which also doesn’t work

The error I am getting is…

Notice: Undefined variable: testing_controller in /Path/To/My/Cache...

I have tried these class/controller file naming structures with no joy…

  • Taxonomy_Maintenance_Package
  • TaxonomyMaintenance_Package
  • MaintenancePackage

Additional info…

Im using Sage v9.0.9

The taxonomy is created using the plugin below and uses underscores between its naming of the slug which I thought might be an issue maybe? possibly?

Any help would be gratefully received… :slight_smile:

You can use a debug plugin like Query Monitor or Debug Bar to show a list of all attempted template paths for a taxonomy:

Related issue:

This topic was automatically closed after 42 days. New replies are no longer allowed.