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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Layouts/ArticleHolder.ss not being used


Go to End


4 Posts   2332 Views

Avatar
sarahk

Community Member, 46 Posts

4 April 2007 at 4:29pm

Edited: 04/04/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?

Avatar
Sean

Forum Moderator, 922 Posts

4 April 2007 at 8:17pm

Edited: 04/04/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

Avatar
Sean

Forum Moderator, 922 Posts

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 = SiteTree

If 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

Avatar
sarahk

Community Member, 46 Posts

5 April 2007 at 11:50am

Edited: 05/04/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.