1268 Posts in 351 Topics by 486 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 912 Views |
-
Home.ss not showing?

1 July 2010 at 11:14pm
Hi all,
very strange behavior happening here. I must be doing something wrong but I can't see what.I made a home page class just so I could template the home page.
I made Home.php
class Home extends Page {
static $add_action = 'Home Page';
}
then Home.ss (which is now sitting in mysite/templates/Home.ss and themes/mytheme/Home.ss and also the Layout folders)
"test"But after I save and publish, ?flush=1, ?flush=all I still get the class name "Home" and thats all thats printing.
Any ideas?
-
Re: Home.ss not showing?

2 July 2010 at 4:47pm
Do you have a controller for that class?? All page types must have a model and a controller. For example in your case
<?php
class Home extends Page {
}
class Home_Controller extends Page_Controller {
}
-
Re: Home.ss not showing?

2 July 2010 at 4:56pm
True! Thanks willr I forgot about adding the controller, its been too long since I used SS.
I was having the same issue with a tag page before I did a test with the home page. Does the following look complete? TagPage.ss should work ya
class TagPage extends Page {
static $add_action = 'Tag Page';
public function Tags() {
return DataObject::get('TagDataObject');
}
}class TagPage_Controler extends Page_Controller {
static $url_handlers = array(
'tag/$Action/$ID/$Name' => 'order'
);
function order($a) {
print_r($a);
}
}
| 912 Views | ||
|
Page:
1
|
Go to Top |


