I have tried searching for answer, but with no luck... Just started my first site on localhost, for learning. Everytime I rename my home page, the new one gets created on dev/build.
Is it possible to have 'page name' and 'navigation label' other than "Home"?
Anyone had a similar issue?
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.
Yes. This is an unfortunate thing, and I'm not sure how to get around it myself, but the answer (work-around) is to simply ensure that the URLSegment remains 'home' (change the page/menu title to whatever you like).
Thank you, Nightjar. It's easy when you know how to do it :-)
I just wish if it was better documented for starters like me. Once again - thanks a lot!
Hi Zile,
Just use the following class as home page:
class HomePage extends Page {
public function onBeforeWrite() {
parent::onBeforeWrite();
$this->URLSegment = 'home';
}
}
class HomePage_Controller extends Page_Controller {
}
This sets the url to 'home' each time the page gets saved.
Magic!
Thank you innoweb!!!