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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Create Page with Controller and Template only (not hidden, but *non-existent* in cms site tree)


Go to End


3 Posts   1264 Views

Avatar
swaiba

Forum Moderator, 1899 Posts

24 August 2010 at 4:10am

Hi,

Could someone explain how to make a page (with layout and controller) but does not appear in the site tree (not hiding from menus, but non-existent in the site tree), like Security/login form?

Barry

Avatar
Martijn

Community Member, 271 Posts

24 August 2010 at 4:44am

class SomePage extends Page implements HiddenClass{

}

Or dont create a model, but only a controller. Name the template CustomPage.ss

class CustomPage_Controller extends Page_Controller{

}

// add this to _config.php

Director::addRules(100,
array('myurlsegmenttoaccessthiscontroller//$Action/$ID/$OtherID' => 'CustomPage_Controller')
);

Avatar
swaiba

Forum Moderator, 1899 Posts

24 August 2010 at 11:52pm

Dank u wel Martijn / Much Appreciated!