Why does my custom controller only uses the appropriate template if ?stage=stage is added to the url?

Silverstripe Version:
4.2.1
Question:
Why does my custom controller only uses the appropriate template if ?stage=stage is added to the url?

I use several classes for presenting pagecontent in diffrerent templates.
remarkably the controller (BasketController) only uses the appropriate template if I put ?stage=stage to the url, without it the stage-statement the standard silverstripe template is used.
Insteresting too, because the BasketController inherits from PageController and should fall back to Page.ss if it doesn’t find the right Basket.ss file, doesn’t it?

any advice appreciated

Fabian

<?php
namespace Silverstripe\Tonnenreinigung;

use Page;
use PageController;
class Basket extends Page
{
}
class Basket_Controller extends PageController
{
}

Where do you store your template? is it under vendor/Silverstripe/Tonnenreinigung/templates/Layout/Basket.ss ?
or
themes/mytheme/templates/Silverstripe/Tonnenreinigung/Layout/Tonnenreinigung ?

It s in themes-projectfolder-\templates\Silverstripe\Tonnenreinigung\Layout

Have you published the Basket page?

Yes it is published.

Don’t know why, but it s working now. I was away from the table for two hours. … no idea

Thanks for the tip :slight_smile:

1 Like