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.

General Questions /

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

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

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


Reply


3 Posts   1036 Views

Avatar
swaiba

Forum Moderator, 1805 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, 1805 Posts

24 August 2010 at 11:52pm

Dank u wel Martijn / Much Appreciated!