Anthony van Beek

Greetings! With GraphQL scaffolding, how do I add child pages to a graphQL query?

Anthony van Beek

Hi there, I’ve added a Course class

  1. <?php
  2.  
  3. namespace {
  4.  
  5. use SilverStripe\CMS\Model\SiteTree;
  6.  
  7. class Course extends SiteTree
  8. {
  9. private static $db = [];
  10.  
  11. private static $has_one = [];
  12. }
  13. }

and would like the courses to be accessed from the urls <domain>/course/<coursename>. How do I make all courses have /course at the start of the URL?

I’ve added courses to my Admin area as :

  1. <?php
  2.  
  3. use SilverStripe\Admin\ModelAdmin;
  4.  
  5. class CourseAdmin extends ModelAdmin
  6. {
  7. private static $managed_models = [
  8. 'Course',
  9. ];
  10.  
  11. private static $url_segment = 'courses';
  12.  
  13. private static $menu_title = 'Courses';
  14. }
stephenmcm

The standard pattern for this would be to create a CourseListingPage and then only allow Courses as child pages

👍 (1)
Anthony van Beek

Hello all. What options are there for making a silverstripe site for a client who has an existing userbase in another silverstripe website and they want to have single sign-on. i.e. they can sign in and create accounts on both sites.