Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

www.domain.com/USERNAME -> template question


Go to End


2 Posts   1354 Views

Avatar
danzzz

Community Member, 175 Posts

8 March 2011 at 7:16am

hi,

I have a own controller to handle request like http://www.domain.com/USERNAME
For this request I call the UController:

class UController extends Page_Controller
{

    public function init() {
        parent::init();
    }

    public function index() {

	print_r($this->request);
        return $this->renderWith("Page.ss");

    }

    public function someaction() {

        // no renderWidth, so no theme/template ???

    }

}

If I call such a URL like http://www.domain.com/USERNAME the page is white, empty, without a template.
How can I set a own theme for such URLs which fits for all actions?

thx

Avatar
danzzz

Community Member, 175 Posts

9 March 2011 at 3:57am

I did it this way:

public function handleAction($request) {
    ....
    return $this->renderWith('U');
}

... or are there other ways ... ?