17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1567 Views |
-
Layouts/ArticleHolder.ss not being used

4 April 2007 at 4:29pm Last edited: 4 April 2007 4:47pm
Not sure what I've done here but ArticlePage.ss is being used, however ArticleHolder.ss isn't.
I've just uploaded that new release (http://www.silverstripe.com/general-discussion/flat/735#post735), I've flushed the cache and the db. No typos etc.
The controller looks fine in the back end, extra fields, icons etc
Any ideas?
-
Re: Layouts/ArticleHolder.ss not being used

4 April 2007 at 8:17pm Last edited: 4 April 2007 8:18pm
Perhaps posting some code may shed some light?
You could also try adding ?flush=1 to the end of the URL, if you haven't already done so, to ensure SilverStripe is looking for the template when before it may not have been.
Cheers!
Sean
-
Re: Layouts/ArticleHolder.ss not being used

5 April 2007 at 9:27am
Another one is to add ?showtemplate=1 to the end of the URL (when on a page which uses ArticleHolder in question), you'll get a bunch of debugging information at the top of the page.
It should show something like this or similar, which is the heirachy of classes for your 'pages':
2 = ArticleHolder
1 = Page
0 = SiteTreeIf ArticleHolder doesn't show up then it's not able to find the template, or the page type hasn't been applied to the page.
Cheers,
Sean -
Re: Layouts/ArticleHolder.ss not being used

5 April 2007 at 11:50am Last edited: 5 April 2007 11:51am
Thanks Sean
I was working through the tutorials and I'd skipped through the Article option and then realised that the ArticlePage was customised but not the Holder.
I've put a debugging email in and it's not being sent. I put it in the same place in ArticlePage and it worked. In admin I can see that the page is set up right, has the icon, is published so I'm halfway there
<?php
/**
* Defines the ArticleHolder page type
*/
class ArticleHolder extends Page {
static $db = array( );
static $has_one = array( );static $allowed_children = array('ArticlePage');
static $icon = "mysite/images/treeicons/news";
}class ArticleHolder_Controller extends Page_Controller {
function index() {
$e = new Email("myemail@gmail.com", "myemail@gmail.com", "in Article Holder", "test");
$e->send();
}
}
?>BTW, ?showtemplate=1 didn't seem to do anything but would be a great debugging tool.
| 1567 Views | ||
|
Page:
1
|
Go to Top |


