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.

Archive

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

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

Layouts/ArticleHolder.ss not being used


Reply

4 Posts   1689 Views

Avatar
sarahk

4 April 2007 at 4:29pm (Last edited: 4 April 2007 4:47pm), Community Member, 46 Posts

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

4 April 2007 at 8:17pm (Last edited: 4 April 2007 8:18pm), Forum Moderator, 921 Posts

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

5 April 2007 at 9:27am Forum Moderator, 921 Posts

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

5 April 2007 at 11:50am (Last edited: 5 April 2007 11:51am), Community Member, 46 Posts

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.