Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » db/build?flush=1

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

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

Page: 1
Go to End
Author Topic: 1376 Views
  • Rube_25
    Avatar
    Community Member
    36 Posts

    db/build?flush=1 Link to this post

       
    Hello

    I would like to know that this happens:

    each time I db/build?flush=1

    I automatically creates a new Home

    Home-2
    Home-3

    and each time I have to delete them

       
    I hope your help
    thanks
    rube

  • François
    Avatar
    25 Posts

    Re: db/build?flush=1 Link to this post

    Same "problem" for me.

    I do NOT want a page named "home". How can we get rid of this "requirement" ?

    Thanks.

  • François
    Avatar
    25 Posts

    Re: db/build?flush=1 Link to this post

    I think found the solution.

    The home page gets re-created (when doing db/build?flush=1) by the method SiteTree->requireDefaultRecords() (starting at line 707 in sapphire/core/model/SiteTree.php)

    Is there any risk to remove this auto-creation of the home page?

    More precisely, is a page named "home" mandatory in the CMS ?

    Thanks for any advice.

  • simon_w
    Avatar
    Forum Moderator
    467 Posts

    Re: db/build?flush=1 Link to this post

    The page with the URLSegment home is used as the home page for every domain where another one isn't specified.

    Getting multiple home pages (home-2, home-3 etc) suggests that you have a class called Home, which is causing SilverStripe to change the URLSegment.

    While the URLSegment is home, nothing else about the page has to be home. You could have a completely different title and navigation label, so long as the URLSegment is still home.

  • François
    Avatar
    25 Posts

    Re: db/build?flush=1 Link to this post

    Thanks for your answer simon_w. But my problem is a bit different.

    The site I develop must be in french, everything. This is a requirement of my client. So, the home page must be called 'accueil' instead of 'home'. That is why I was very annoyed to see a 'home' re-createad each time a did a db rebuild.

    Finally, the solution is very simple:

    1) delete the code which is responsible for the creation of the 'home' page. This is the code in SiteTree->requireDefaultRecords() which I mentionned in my previous post.

    2) set up my "new" home page by putting my domain name in the "Domains" field of the "Behavior" properties of the page.

    That's it!

    In my opinion I think that's not a very good idea to include such "magic" (the automatic creation of some content) in a product. A better place would be in an external script clearly documented. But, anyway, I found a solution and that's the most important. I still love SilverStripe!

    1376 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.