Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » open a page without menu's

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

Page: 1
Go to End
Author Topic: 815 Views
  • macka
    Avatar
    Community Member
    22 Posts

    open a page without menu's Link to this post

    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

  • martimiz
    Avatar
    Forum Moderator
    1038 Posts

    Re: open a page without menu's Link to this post

    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',
    ...
    );

  • macka
    Avatar
    Community Member
    22 Posts

    Re: open a page without menu's Link to this post

    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

    815 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.