17486 Posts in 4473 Topics by 1978 members
|Go to End|
16 September 2008 at 9:03am
I would like to know that this happens:
each time I db/build?flush=1
I automatically creates a new Home
and each time I have to delete them
I hope your help
17 October 2008 at 9:18am
Same "problem" for me.
I do NOT want a page named "home". How can we get rid of this "requirement" ?
17 October 2008 at 10:07am Last edited: 17 October 2008 10:07am
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.
17 October 2008 at 10:14am
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.
18 October 2008 at 8:18am
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.
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!
|Go to Top|