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

open a page without menu's


Go to End


3 Posts   1215 Views

Avatar
macka

Community Member, 33 Posts

17 January 2011 at 3:08pm

Hi there,

I want to open a specific page (into an iFrame), but without the side menu's etc. Just literally the page.

Is it a case of making a new template? if someone could prod me in the right direction that would be great.

Thanks
Grant

Avatar
martimiz

Forum Moderator, 1391 Posts

18 January 2011 at 4:47am

You could load the page with an 'action'. If your page url is mysite/somepage/, load it into the iframe like mysite/somepage/inframe/

Then define an action in your page controler that renders the page (using a CustomPage.ss template):

function inframe() {
  return $this->renderWith(array('CustomPage'));
} 

Add inframe to your allowed actions, if you will:

  public static $allowed_actions = array (
    'inframe',
    ...
  );

Avatar
macka

Community Member, 33 Posts

31 January 2011 at 11:03pm

Hi martimiz,

Sorry to sound so silly, but where do i put the first function? in the mysite/code/page.php ??

Then how do i call the function? ie, when i specify the link in the CMS, will there be something special to do?

Grant