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.

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   1328 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!