21286 Posts in 5733 Topics by 2602 members
| Go to End | ||
| Author | Topic: | 1143 Views |
-
Re: Open different template

6 January 2010 at 4:44pm Last edited: 6 January 2010 4:49pm
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 Page.ss file?
This is the error I am getting...
[Warning] None of these templates can be found: PagePopop.ssI have a PagePopop.ss in the templates folder under themes...
This is my PagePopop.php file
<?php
class PagePopup extends Page {
static $db = array(
);
static $has_one = array(
);}
class PagePopup_Controller extends Page_Controller {
function init() {
parent::init();
Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
}
}?>
My function looks like this in the Page.php file
function popup() {
return $this->renderWith('PagePopop');
} -
Re: Open different template

6 January 2010 at 4:53pm
I got the PagePopup.ss to load without errors, but it is blank. How do I now get the content from the page I am loading...
mysite.com/disclaimer/popup - needs to get the content from disclaimer
I'm getting close, I will continue.
-
Re: Open different template

6 January 2010 at 4:57pm
Hi AdamJ,
Can you expand on what you are saying here...
"...after the URLsegment of each page"
Where should I have the URLsegment?
-
Re: Open different template

6 January 2010 at 6:13pm
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) %>
$Content
<% 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 PagePopup.ss
mysite.com/disclaimer/popup
When I click on another page link, like mysite.com/terms/popup - how can I render the PagePopup.ss template with the "terms" pages $Content?
-
Re: Open different template

6 January 2010 at 6:46pm
I got it all working by making separate pages. I would still like to get an if statement into one page - any ideas?
| 1143 Views | ||
| Go to Top |

