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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Children of Holder Pages not accessible in backend


Go to End


769 Views

Avatar
Snowlord

Community Member, 7 Posts

8 January 2015 at 2:16pm

I've built two sets of Holder/Article pages. Within the backend, I cannot access the children of several of them unless I filter by 'page type' (see photo). I've moved the hierarchy of parent pages within the section around as well as even moved them completely outside of the root level page, still, no matter what the order they are placed, only the top TWO show it has children (unless filtered) (see 2nd photo).

I've looked in the DB and all the references are correct and linking to the correct parent files. I'm stumped.

Holder and Article Code here:

 
<?php
class CaseStudiesHolder extends Page {

private static $allowed_children = array('CaseStudies'
);

  public static $db = array(
    'Popup' => 'Text',
    'IntroShort' => 'HTMLText',
);


 public static $has_one = array(
        'HeaderImage' => 'Image',
        'SectionTitle' => 'Image',
  );

  function getCMSFields() {

    $fields = parent::getCMSFields();
        
     $fields->addFieldToTab('Root.Content.Images', new UploadField('HeaderImage', 'Header Image'));
     $fields->addFieldToTab('Root.Content.Images', new UploadField('SectionTitle', 'Section Title'));
     $fields->addFieldToTab("Root.Content.Main", new HTMLEditorField('IntroShort', 'Case Study Short Blurb'));
        
    
    return $fields;
  }

}


class CaseStudiesHolder_Controller extends Page_Controller {
}

 
<?php
class CaseStudies extends Page {

  public static $db = array(
    'Popup' => 'Text',
    'StudyShort' => 'HTMLText',
    'StudyHeadline' => 'HTMLText',
    'StudyPhotos' => 'HTMLText',
    'StudyCopy' => 'HTMLText',

);

  public static $has_one = array(
        'Image1' => 'Image',

  );
  
  static $has_many = array (
  );

  function getCMSFields() {

    $fields = parent::getCMSFields();
        
    $fields->removeFieldFromTab("Root.Content.Main", "Content"); 
    
 
    $fields->addFieldToTab("Root.Content.Main", new TextField('Popup', 'Case Study Label'));
    $fields->addFieldToTab("Root.Content.Main", new HTMLEditorField('StudyShort', 'Case Study Short Blurb'));
    $fields->addFieldToTab("Root.Content.Main", new HTMLEditorField('StudyHeadline', 'Case Study Headline'));
    $fields->addFieldToTab("Root.Content.Main", new HTMLEditorField('StudyCopy', 'Case Study Copy'));
    $fields->addFieldToTab("Root.Content.Main", new HTMLEditorField('StudyPhotos', 'Case Study Photos'));
    $fields->addFieldToTab('Root.Content.Image', new UploadField('Image1', 'Header Image'));
        
    
    return $fields;
  }

}

class CaseStudies_Controller extends Page_Controller {
}

Attached Files