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

Open different template


13 Posts   1624 Views


6 January 2010 at 4:44pm (Last edited: 6 January 2010 4:49pm), Community Member, 224 Posts

When I did the popup thing, it did bring up the right template - it has errors, but I'll work through that.

Just so I know, is the /popup calling the function that is set in the file?

This is the error I am getting...
[Warning] None of these templates can be found:

I have a in the templates folder under themes...

This is my PagePopop.php file


class PagePopup extends Page {
   static $db = array(
   static $has_one = array(


class PagePopup_Controller extends Page_Controller {
   function init() {


My function looks like this in the Page.php file

function popup() {
   return $this->renderWith('PagePopop');


6 January 2010 at 4:53pm Community Member, 224 Posts

I got the to load without errors, but it is blank. How do I now get the content from the page I am loading... - needs to get the content from disclaimer

I'm getting close, I will continue.


6 January 2010 at 4:57pm Community Member, 224 Posts

Hi AdamJ,

Can you expand on what you are saying here...

"...after the URLsegment of each page"

Where should I have the URLsegment?


6 January 2010 at 6:13pm Community Member, 224 Posts

How can I add an <% if ??? %> to this to find out what page the control is calling?

When I hardcode this in the page I can bring up the content of the other page - this is a great step forward.

<% control Page(disclaimer) %>
<% end_control %>

In my Page.php file I have..

class Page_Controller extends ContentController {

function popup() {
return $this->renderWith('PagePopup');


I then call up my template called

When I click on another page link, like - how can I render the template with the "terms" pages $Content?


6 January 2010 at 6:46pm Community Member, 224 Posts

I got it all working by making separate pages. I would still like to get an if statement into one page - any ideas?